“The Chinese are genuinely unprepared for this degree of pushback,” Mr. Soares de Oliveira said.

China’s Foreign Ministry rejected the notion that its role had been anything but fruitful. In Niger, it said, it has improved the economy, has hired local residents and is building schools, digging wells and carrying out other “public welfare activities.” In Chad, it said, it has urged companies to protect the environment and will seek to resolve the dispute through “friendly negotiation.” In Gabon, as elsewhere, it said, it supports cooperation “on the basis of equality, amity and mutual benefit.”

Few nations in the world are as weak as Niger, where nearly half of the government budget comes from foreign donors. But the nation long had unfulfilled oil dreams that were largely ignored by major companies. In 2008, two partners came together secretively — the country’s autocratic ruler, Mamadou Tandja, and China National Petroleum — and signed an unpublicized deal that seemed to give both parties what they wanted.

But far less clear, then and now, was whether Niger — one of the world’s most impoverished countries, regularly threatened by famine — would substantially benefit from the deal.

Mr. Tandja got a costly oil refinery in an area of Niger that he needed to win over with the promise of development, but the need for such a project in this low-energy-consuming nation has been sharply questioned by experts, not to mention the mysterious $300 million “signing bonus” Mr. Tandja’s administration received.

In return, the Chinese got access to untapped oil reserves in the remote fields on Chad’s border on terms that still make Oil Ministry officials here wince. Beyond that, local residents have protested that the Chinese presence has brought few jobs, low pay and harsh working conditions.

Mr. Tandja is long gone, deposed in a 2010 coup by army officers suspicious of his grab for expansive powers, but the contract remains, as does the white-elephant oil refinery. It sits at the border with Nigeria, a nation awash in subsidized oil that crosses into Niger as contraband. The refinery has a capacity that is three times Niger’s consumption, and the overall cost should have been only $784 million, according to a United Nations expert. Niger must still pay 40 percent of the original cost, with money lent to it by the Chinese.

“In the context of this fight, we are revisiting these contracts to correct them,” said Mr. Gado, the oil minister in the new democratic government led by an opponent of Mr. Tandja. “In the future, we will pay closer attention, to not make the same mistakes.”