In March, Lamido Sanusi, Nigeria's central bank governor, spoke out against Chinese exploitation of Africa and its vast resources and warned that Africa "is opening itself up to a new form of imperialism."
In a scathing commentary for The Financial Times, he cautioned: "China takes from us primary goods and sells us manufactured ones. This was also the essence of colonialism."
Trade between China and Africa was worth more than $200 billion in 2012, 20 times what it was in 2000 when Beijing initiated a policy of "accelerated engagement" with the continent for access to its oil and gas, copper, gold and many other mineral resources that China needs to sustain its economic power.
The actions by Ghana and Gabon are emblematic of the turnaround in the relationship that many African states are undergoing these days despite the extensive infrastructure projects Beijing had undertaken, using its vast cash resources.
China's new president, Xi Jinping, toured Africa in March, underlining the continent's strategic importance to Beijing in its relentless drive to acquire vital resources in return for massive investment.
He declared in Dar es Salaam, capital of Tanzania, where he inaugurated the $10 billion Bagamoyo port project designed as a hub for trade between East Africa and Asia, that Beijing will make good on a 2012 pledge to provide $20 billion in loans in three years for African infrastructure development, agriculture and business.
Oil and coal accounted for half of China's imports from Africa in 2012, minerals and other raw materials made up most of the rest.
However, one of the main purposes of Xi's African tour, his first foreign trip as president, was to change the growing perception across Africa that China is just another imperial power exploiting the continent for its labor and resources.
But, the bottom line is resources, supply routes and maritime security -- in the Indian Ocean, and the chokepoint Malacca Strait through Malaysia, Singapore and Indonesia -- were the central drivers of Xi's tour.
"China's economic growth, even if it is slowing, still consumes vast amounts of imported raw materials and energy," the U.S. global security consultancy Stratfor observed.
"Long gone are the days when China could be self-sufficient, and even its agriculture is reaching the limits of supplying food to its vast population.
"This presents a strategic dilemma for Beijing, which must keep China's economy active and growing in order to maintain social stability and to provide work, income and materials to China's citizens.
"The economic activity has made China ever more dependent on overseas-sourced raw materials as well as markets," Stratfor noted.
China has long boasted of its role as a supporter of African efforts to throw off Western colonialism. But now many Africans are starting to view China as just one more foreign exploiter.
Beijing, through the China Export-Import Bank, the financing arm of Chinese projects in Africa, is making huge investments in the oil, mining and construction sectors.
This concessional financing, combining loans and grants, has mainly targeted commercially driven projects in more than 40 countries in Africa, with Ethiopia, Angola, Sudan and Nigeria -- the last three key oil suppliers to Beijing -- being the key beneficiaries.
But anti-Chinese sentiment has been building for some time. In August 2012, striking Zambian coal miners killed a Chinese supervisor in a wage dispute.
The arrests in Ghana were the latest crackdown by authorities. Some 120 illegal Chinese miners -- there are 10,000 in the West African state -- were rounded up in March.
"Illegal mining in Ghana has assumed alarming proportions," the Ministry of Natural Resources said. "Foreign nationals, especially the Chinese, have made the problems a lot worse.
"They have access to huge funds which they've been using to bring in enormous numbers of excavators, which can destroy large areas of forest in just one day."
Gabon's move against Sinopec, which comes as the country prepares to license offshore oil exploration, is part of its drive to wring better terms from foreign multinationals and clamp down on large-scale tax evasion, with China a primary target.