analysisBy Hugo Brennan
With Beijing backing some unpopular regional regimes and suppressing Muslim Uyghurs back home, Chinese workers could soon find themselves on the wrong side Islamist militant groups.
Although China's role in North Africa generally gets less attention than its investments south of the Sahara, the Asian giant's economic, political and security footprint in this region has also long been widening and deepening.
China is heavily engaged in Libya and Algeria's energy, mineral and construction sectors, the number of Chinese migrants to the region is believed to be steadily rising, and as with the rest of the continent, Chinese manufacturers are happily taking advantage of the demand for cheap manufactured goods.
However, along with China's growing opportunities, influence and presence in North Africa, there have also emerged some new dangers - not least the rising threat from militant Islamist groups operating in the region.
Although these armed groups may be pleased at one level to see their traditional Western enemies being displaced to an extent by the Chinese, the new Eastern power could also find itself being targeted.
After all especially since the Arab uprisings of 2011, China has made a number of diplomatic missteps in which it could have been seen to be backing the wrong horse, while its treatment of its own Muslim Uyghur population back home could mean its rise in North Africa is seen by some as one infidel replacing another.
Though China may want to conduct a strictly business approach to its foreign policy and try not to interfere in anyone else's domestic affairs, it is finding that its heavy footprint will inevitably shake some groups up the wrong way.
On AQIM's radar
The group most likely threaten Chinese security in North Africa is al-Qaeda in the Islamic Maghreb (AQIM), a militant group born from Algeria's Salafist Group for Preaching and Combat (GSPC).
GSPC's original aims were overthrowing the Algerian government and replacing it with an Islamic state, but a franchise deal with al-Qaeda in late 2006 saw it adopt a more globalised doctrine, and by 2007 it had adopted the al-Qaeda name.
AQIM is believed to be one of the best funded and well-armed of the al-Qaeda groups, and the militants have benefited recently from the fall of authoritarian governments in the Arab Spring and emergence of large ungoverned spaces.
Although China has not traditionally been an enemy of AQIM, its growing presence and links to regimes abhorred by the militants could make it a legitimate target.
China's links to the Algerian government - which date back over half a century ago to the country's war of independence - have recently been enhanced in the form of multi-billion dollar infrastructure projects, high-level military exchanges and arms sales.
In Libya, China was not only reluctant to recognise the National Transitional Council during the 2011 uprising, but allegedly sold $200 million worth of arms to the ailing regime of Colonel Muammar Gaddafi. And in Syria, China's continuing support for Bashar al-Assad - through economic ties and its rigid principle of non-intervention - is antagonising many Sunni Arabs.
As has occurred many times before - whether in Sudan, Zimbabwe or North Korea - China's insistence on a 'non-political' approach to relations with other countries, whilst supported by some, has tarnished its reputation amongst others and potentially earned the country some new enemies.
However, support for regimes opposed by militant Islamists is not the only reason China could find itself in the firing line.
Although China's suppression of its Uyghur population - a largely Muslim Turkic ethnic group mostly living in Xinjiang province, in China's far Northwest - has not been fully internationalised by al-Qaeda, there are signs this is beginning to change.
The Uyghurs have long been demanding autonomy and freedom to practice their religion, and over the past decade, the government has responded by suppressing protests, arresting activists and allegedly trying to dilute Uyghur influence in the region by encouraging the mass immigration of Han Chinese to the area.
In 2009, these tensions led to riots breaking out in the city of Ürümqi between Uyghurs, Han Chinese and police. According to officials, nearly 200 people were killed, though some groups believe the death toll was higher, and over 1,700 people were injured.
In the wake of this violence, AQIM reportedly issued a call for "reprisals", labelling China as a legitimate target whose interests in North Africa could be targeted.
Not long after, Yahya al-Libi, a Libyan national believed to have once been al-Qaeda's third-in-command, denounced China's rule in Xinjiang as one of "injustice and oppression."
This year, tensions in Xinjiang have only escalated, and serious incidents of violence in April, June and August left scores dead. Furthermore, these dynamics spread to the Beijing for the first time on 28 October when a jeep ploughed into a crowd of tourists in Tiananmen Square, killing five and injuring dozens.
The Chinese government blamed the attack on Uyghur militants belonging to the East Turkestan Islamic Movement (ETIM), a separatist group who were placed on the US' terrorist list in 2001, and denounced Uyghur youths who "blindly follow religious extremist forces."
Since the assault, Beijing has also tightened security in Xinjiang, a region that already often felt like it was under military occupation, and at the end of November encouraged women to unveil in a campaign dubbed Project Beauty.
Although analysts remain sceptical of any purported links between the Tiananmen attack and overseas militants, it does seem that violence is slowly escalating in China.
Add to this the alleged presence of Uyghur militants fighting alongside Islamist opposition forces in Syria, and it seems the group is raising its international profile. If China continues to suppress the religious freedoms of its 10 million Uyghurs in Xinjiang, it may start feeling the effects in North Africa.
China's soft underbelly
Arguably, the targeting of Chinese workers in North Africa has already started. In June 2009, 40 Chinese workers were attacked by AQIM in Algeria as their convoy travelled to a worksite, leaving one dead and two hospitalised.
Coming soon after the Ürümqi riots, some interpreted this as a deliberate assault on Chinese nationals, but leaked US embassy cables suggest that the Algerian soldiers accompanying the convoy, 24 of whom were killed, were the real targets.
However, if the thousands of Chinese labourers working on infrastructure projects on sites across the Maghreb were to be directly sought out for reprisals, they would likely prove to be a fairly soft target.
Though it is notoriously difficult to ascertain exactly how many Chinese nationals there are in the region, the numbers are significant - at the height of the Libyan uprising, China evacuated 36,000 workers from that country alone.
But while the Chinese government talks about the importance keeping its overseas workforce safe, it only has a nascent (although developing) ability to protect its nationals.
China lacks certain military capabilities such as the ability to deploy Special Forces, while private Chinese security firms, which are increasingly being employed to protect workers, still lack a degree of professionalism and experience.
This makes China reliant on negotiation and ransom payments when workers are kidnapped, as was the case in Sudan and Egypt in 2012, and this could in fact be an additional tempting factor for the likes of AQIM for which hostage-taking has been a central part of fundraising.
Indeed, for a number of reasons - from its growing presence in the region to its support for unpopular regimes to its domestic treatment of Uyghurs - the motivation for AQIM and other Islamist militants to target China and its interests in the Maghreb seems to be on the up; the future security of thousands of Chinese workers could well depend on how seriously and urgently Beijing is taking this threat.
Hugo Brennan is an analyst of and writer on China. He has a particular interest in Chinese foreign policy and minority rights. He holds a Masters degree from SOAS. Follow him on twitter @hugobrennan1988