Dozens of Chinese workers held last week for alleged illegal mining in Ghana will soon be released, according to officials in Beijing.

The 124 Chinese gold miners detained in an immigration detention center will be released Monday, the Chinese embassy in Accra said, after an agreement with Ghanian authorities was reached. Another 45 Chinese workers held at a national security detention center will also be freed.

The miners, mostly from Shanglin county in China’s southwest province of Guangxi, were also promised safe passage if they were willing to go home.

“As long as they are willing to leave their equipment behind and go home, they will be left alone,” said a local Shanglin government official who was sent to Ghana as part of a task force.

About 12,000 Chinese miners remain in hiding in Ghana, fearful of their lives due to alleged police brutality, reports the Financial Times.

Ghanian authorities denied that any of the arrested miners had been mistreated. “Not a single bullet has been fired against Chinese workers. None have been beaten. All of those allegations are untrue,” said Michael Amoako-Atta, spokesman for Ghana’s immigration service.