The rising price of gold has intensified a decade long conflict between international companies and the small-scale miners they replaced.
Over the 1990s, Tanzania dismantled its socialist institutions and brought in international miners, who forced out tens of thousands of artisan miners from areas their families had mined for generations.
Tanzania's ministry of Energy and Minerals estimates that around 40,000 such miners have been displaced since 1998.
The foreign companies have turned Tanzania into the third-largest producer of gold on the continent, after South Africa and Ghana, but frictions between them and the artisanal miners have moved from charges of theft to outright confrontation.
"Artisan miners were the first to discover and mine gold at the present locations of large-scale mines. Companies came in later to apply for large-scale mining leases, paving the way for their displacement," said Tindu Lissu, a human-rights lawyer who heads Tanzania's Lawyers Environmental Action Team.
Analysts estimate that artisan miners account for between 5 per cent and 8 per cent of Tanzania's total gold output.
Compared with other commodities, the risk-to-reward ratio of taking gold from mines is especially attractive for a people already skilled in extracting the metal.
"It's unique to gold because it's easier to mine on the side; you're not going to run off with 500 tons of iron ore," said Brock Salier, an analyst at Ambrian Capital in London.
Tanzania is not alone in experiencing confrontations. In May last year, a group of people entered AngloGold Ashanti Ltd's Obuasi mine in Ghana carrying machetes.
A month later, a local community member held two Obuasi staff members hostage for several hours, AngloGold said.
In February of this year, Pan African Resources PLC said trespassers entered its South African Barberton gold mine to mine illegally, which led to the death of five people.
In Tanzania's Mara region, Barrick Gold Corp.'s North Mara Gold Mine finds itself embroiled in daily confrontations with locals, managers say. Between 200 and 300 illegal miners trespass on licensed areas every day in search of ore, according to Gerhard Hermann, production manager of the mine, which is surrounded by 13 villages in the densely populated Tarime district, 20 kilometers south of the Kenyan border.
At just one pit at the mine, illegal mining resulted in the loss of about 2,400 hours' work last year, the Canadian company said.
The artisan miners operate in groups of three to five men.
They use hand-held shovels to dig out low-grade ore, then move the ore in polythene bags to surrounding villages, where women and children extract the gold using mercury.
This gold is later sold to traders around Lake Victoria before being shipped for export to overseas markets. Mr Hermannn says that since 2006, North Mara has lost up to $25 million of property and gold ore to what he described as vandalism by locals.
The efforts to stave off these small-scale miners by force have worsened the friction. Bringing in security guards, which helped Anglogold at Geita, has caused more trouble for Barrick at North Mara.
After the deployment of up to 25 paramilitary police guards in recent months, confrontations with locals increased and there have been a number of shootings.
According to Charcha Murwa, the head of Foundation Help, a local nongovernmental organization monitoring human rights, the local guards are also corrupt and extort money from artisan miners to allow them access to the premises of the mine.
North Mara management says it can't be held responsible for the actions of the police guards. "They are deployed by government and draw a government salary, they are not on our payroll," said Mr. Hermann.
In Tanzania the government hopes that tensions and confrontations between large mining corporations and locals can be reduced by revising the 1998 Minerals Act, which is largely credited for attracting the current investment.
The Ministry of Energy and Minerals says that amendments will largely reflect recommendations of a presidential panel appointed last year, following an outcry from politicians and activists that the current law favors large corporations at the expanse of locals and artisan miners.
Some of the recommendations of the panel include the state taking 15 per cent stakes in all mining company operations in Tanzania, hiking taxes for mining companies, and improving compensation for locals and artisan miners as a means of paving the way for large-scale mines.
"Compensation packages being paid by Barrick are less than the market value. Locals know their rights; that's why they're rejecting the packages," said Mr Lissu, who has studied the problems affecting North Mara.
Teweli Teweli, spokesman for mining company Barrick Tanzania Ltd, rejects the charge, saying the company's packages are always in line with the government evaluator's valuations.
Mr Hermann, the North Mara production manager, said the company sometimes pays locals more than the sum arrived at by the valuer.
In October, the International Council on Mining and Metals warned that changing Tanzania's current mining legislation could jeopardize future investments.
The group said that mining companies operating in Tanzania needed to invest an additional $2.32 billion in total by 2034 to keep the sector afloat, and changing the law may hamper this investment.
Poor infrastructure serves as a drag on mining operations already there.
In a single night, AngloGold's mine in Tanzania lost close to 50,000 liters of fuel to hundreds of people who crossed the Kenyan border on bicycle and left the same way loaded down with plastic containers.
The fuel, used to power generators at the Geita mine because of the unreliability of the electricity grid, has to be trucked into the country's northwest through Kenya from the port of Mombasa because Tanzania's major port at Dar es Salaam is too congested.
Mr Lyimo said AngloGold's costs have been pushed up because it has to rely on generators for its mine. He said the national grid, even if it were available at Geita, isn't reliable. Instead, fuel is trucked in from Kenya , the Tanzanian port of Dar es Salaam is in need of modernization and rail can't reliably handle the shipments, he said.
"We should be very profitable here," Mr Lyimo said. "But we have to incur expenses you never thought you would."