Huang Ren Zhong's striped parasol stands out against the muddy cliff of excavated earth. The horizon is fringed with the tall trees of the Ghanaian rainforest, but for Huang, this dilapidated shelter is his only shade from the sweltering tropical sun. He and his Chinese colleagues take turns to sit under it, overseeing the digging and churning of the murky water beneath them, where they are mining a huge pit for gold.

Two years ago, Huang, 40, left his tea farm in China's Guangdong province to seek riches here in west Africa. Since then his work has been hot and arduous, and at times dangerous but, by his standards, the rewards are great. Huang says he makes about 4,000 yuan – £420 – a month. His salary is paid straight to his family in China, after the money he needs to live has been deducted.

"The work is difficult. [But] I came here to make money," said Huang. "In China, I was average or poor. To have the opportunity to travel abroad [and] make more money is fantastic."

Huang works in one of many illegal small-scale goldmines in Ghana, Africa's second largest gold producer. Ghana's minerals commission, which provides permits for small mines, has not authorised the site. Foreigners are banned from working in Ghana's small-scale mining industry, which was formalised in the 1980s to bring much-needed income to poor, rural communities.

Figures for the scale of illegal mining are non-existent because the Ghanaian authorities struggle to address the problem. But 23% of Ghana's gold production is from small-scale mining. Some estimates calculate that 95% of all small-scale mining in Ghana is illegal.

The authorities admit that the influx of Chinese miners and their wealthy backers is causing environmental destruction and social conflict on an unprecedented scale. The Chinese have invested millions of dollars in excavators and industrial equipment.

"The scale [of illegal mining in Ghana] is so vast it is difficult to actually quantify," said Brigadier General Daniel Mishio, chairman of Ghana's national security commission for lands and natural resources. "Apart from the security threat that is posed by the weapons that [illegal miners] wield, we even also have issues of human security," he said. "In certain areas, people don't even get clean drinking water, and in some areas you can see that most of the forest cover has been destroyed. This poses a very big danger to our future."

The work is also risky: last week 17 people were killed at a mine in Kyekyiwere in central Ghana. Mishio leads a taskforce conducting raids on illegal mines. Last month 120 Chinese miners were arrested .

Tensions in Ghana towards immigrants from China – Ghana's biggest trading partner – have led the president to reassure Chinese investors that the west African country remains keen to encourage economic co-operation. Both Beijing and Accra insist that there is no connection between the countries' bilateral agreements, including a recent $3bn China Development Bank loan to Ghana, and the activities of illegal Chinese immigrants. But many blame Accra for failing to prevent the destruction of large swaths of land for illegal mining.

"In Ghana and elsewhere in Africa, small-scale mining is a strategic livelihood alternative for rural communities, and it contributes tremendously to the local economy," said Wilbert Brentum, from Solidaridad, which works to improve safety standards and ethical practices in goldmining. "But we have a situation in Ghana now where there is more illegal small-scale mining than there is legal. This has magnified the environmental degradation and polluted so many of our water bodies. Because it has attracted more people into the small-scale mining sector, without protective equipment, fatalities are also on the increase."

"[This illegal mining] doesn't help us at all," said Kweku Gyaminah, 29, a witchdoctor in Manso Abodom, who makes over £1,000 a week from trading gold mined by villagers – many of them children – on the fringes of the illegal Chinese-run mine where Huang works. "Now all our drinking water is all polluted, the farms [are] all gone and we haven't had any benefit from that."

Resentment towards foreigners is widespread. There are frequent attacks by Ghanaians against increasingly heavily armed Chinese miners. The Chinese are also accused of assaulting Ghanaians, whom they employ to operate their machinery. On the site where Huang and his colleagues work, the ground is littered with spent shotgun cartridges. "We have the guns to defend ourselves from the locals," said Huang.

Many of the Chinese guns are said to come from the police, a practice which one senior officer said was indicative of the widespread corruption fuelled by the influx of foreigners propped up by cash from illegally mining gold.

"The Chinese are armed [and] most of the time the guns are sold by policemen," said a senior police officer, speaking on condition of anonymity. There have been several high-profile cases of police corruption in relation to Chinese illegal mining recently. In early April five policemen were arrested for robbing a Chinese miner at gunpoint, after the incident was captured on CCTV.

"It is standard practice for small-scale miners who work illegally with foreigners to pay off the police," one Ghanaian mine owner said. "We have a budget for the police and for the immigration authorities, and every month we pay them to leave us alone."

"Mining has corrupted the people," said the senior officer. "Certain policemen take advantage and profit from these activities. Some prominent men in Ghana, too, are benefiting [and] some traditional rulers."

There have been calls for the whole gold industry to be cleaned up. The government's precious minerals and marketing commission (PMMC), which buys gold produced in Ghana, told the Guardian it did not buy illegally mined gold.

"The PMMC only buys gold from small-scale miners who are Ghanaian nationals, which is in accordance with the mandate setting up the company," it said.

But the Guardian filmed dozens of Chinese miners entering a PMMC-licensed agent in Dunkwa, a gold-producing centre in Ghana's central region, each leaving with plastic bags full of what looked like cash. Inside the shop, called "IndoGhana Gold Agents", the Chinese handed over pieces of gold, which were weighed by staff and placed in a safe.

The manager, Govinda Gupta, said he was unaware it was illegal for his company to buy gold from the Chinese, and that the company buys at least 5kg of gold every week, which it exports to India via Dubai.

"There should be more traceability in gold," said Brentum, who is part of a worldwide initiative to produce gold certified "Fairtrade" and "Fairmined" , and which aims to make 5% of all gold responsibly mined by 2025.

While trade in precious minerals such as diamonds has undergone reforms in recent years to make their origins more transparent, the gold industry remains highly opaque. During refining, gold from different sources is mixed together so that it is impossible to trace.

"There is a growing market for ethical gold, and we foresee a time when all gold will have to be responsibly mined, which would ensure protection for the environment and people who work in mines," said Brentum.

"But if you look at the large-scale industrial mines, they are well aware of their environmental and health and safety obligations, and will have no problem catering to this market. Our concern is that the small-scale and artisanal miners will be left behind.

"Illegal mining is a blot on the image of all small-scale mining. It is the people working in rural communities in Ghana – the very people who were supposed to benefit from the legalisation of small-scale mining – who will suffer the most."

Gold in Ghana

Once named the Gold Coast, Ghana is famous for its gold production, which has been carried out by local people using artisanal techniques since at least the 15th century.

Small-scale mining was legalised in 1989 under the military regime of Jerry John Rawlings to "indigenise" the industry for the benefit of Ghanaians. The law forbids non-citizens from engaging in small-scale mining.

Ghana is the 10th largest gold producer in the world and the second largest in Africa, after South Africa. It produced 4.2m ounces last year, worth $1,668 per ounce.

23% of Ghana's gold exports come from small-scale mining. As many as 95% of small-scale mines in Ghana are believed to be illegal, many operated by Chinese nationals.

• This article was amended on 23 April 2013. The Chinese province is Guangdong, not Guangzhou, as the article originally stated.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.