Violent incidents, almost exclusively focused on black men, are an indication of deep-seated racism in China, writes Clifford Coonanin Beijing.
TRAFFIC WAS restricted, Beijing hung with bunting and a party atmosphere prevailed. Not the Olympics, but the China-Africa forum in 2006, one of the biggest public gatherings in Beijing before the Games, when China invited delegates from dozens of African nations to underline the continent's importance to the world's fastest growing economy.
China has been criticised for ignoring human rights and environmental concerns and for not attaching demands for transparency and accountability to offers of aid, loans and investment to Africa - particularly oil producers Sudan and Angola, which is China's largest supplier of crude oil.
This is less surprising when you consider the strong ideological backdrop to Sino-African relations.
The late premier Zhou Enlai once famously said that racism did not exist in China.
Unlike many western countries, China does not have a black slave-owning tradition and the Communist Party sought to ally thinking on race with thinking on the class struggle, which led to African students coming to China to study in the 1960s and 1970s. Most did not stay long, however.
As in many countries, there is a deep-seated racism in China, which originated in the late 19th century arguments about origins of Chinese people, bloodlines and racial stereotypes that were also common in Europe.
Other sociologists also trace anti-African sentiment to imperial-era thinking about race, as well as the commonly held belief that to be poor is a sign of weakness.
When the Communist Party came to power in 1949, it abolished racism and set about building ties with fellow revolutionaries in African nations to form the "Third World coalition" against what it saw as "white imperialist running dogs".
But tensions have always existed. In July 1979, Chinese students attacked a foreigner hall of residence in Shanghai, complaining that African students were playing loud music.
Subsequent reports blamed the Chinese students for their actions, but said drunken, womanising Africans were also to blame.
Relations between African men and Chinese women, in particular, have caused many disturbances over the years.
They reached their height with the Nanjing protests in December 1988, which saw confrontations between African and Chinese students at the eastern city's Hehai University.
Trouble erupted when two African male students were stopped entering a Christmas party as they were escorting two Chinese women, in contravention of a college rule to stop fraternisation in the dormitories.
A subsequent fight eventually turned into full-scale unrest and chants of "Kill the black devils".
The Nanjing protests were a trigger for the student-led pro-democracy movement in 1989, which was deeply nationalistic in essence. The movement was famously crushed in Beijing on June 4th of that year.
More recently, dozens of black tourists and expatriates, including the son of the Grenadian ambassador, were arrested and, in some cases, beaten up during an anti-drug sting in Beijing's bar area, Sanlitun, last year.
Eye-witnesses said the raid seemed to focus exclusively on black men. The crackdown shocked Beijing's foreign community.
Earlier this year, publicans said they had been told by police not to serve black people in Sanlitun in the run-up to the Olympics.
Despite lingering racist sentiment, the numbers of Africans coming to China is increasing.
There are around 600 African students studying in colleges in Beijing. Africans say they experience little hostile racism, although they do have to put up with an awful lot of prejudicial comments about skin colour and sexual issues. One Ugandan woman friend was offered 200 yuan (€20) by her Chinese plumber if she would have sex with him.
Some attitudes take longer to change than others.