The Ghanaian university student was roused after midnight by police shouting and pounding on his door in the southern Chinese city of Guangzhou, where a crackdown on illegal immigration has left many residents of its "Little Africa" neighbourhood feeling scared and angry.
After demanding to see his visa, the agents carefully checked his papers before leaving to knock on other doors.
The commercial hub has long been a magnet for fortune-seeking Africans, but traders and students say they face unfavourable visa rules and increasingly heavy policing.
"They do this because Africans live here," the Ghanaian student told AFP as he stood on a pedestrian bridge in the bustling city, still upset over last summer's after-dark visit.
"I was sick of being treated like a criminal. I had to move to another neighbourhood," he said, gesturing at a nearby police station and lamenting that the omnipresent security had made life more complicated.
Migration from Africa has risen in recent years as China has stepped up its diplomatic links and investments with the continent.
Guangzhou draws merchants who come to buy goods such as jewellery and electronics in bulk, which they ship back to their homelands.
But in January, the official Xinhua news agency reported that the African population in Guangzhou had decreased as "police have tightened enforcement on illegal immigration".
There are now 15 000 Africans living in the city compared to 20 000 in 2009, but "the real number, including illegal immigrants and overstayers, is believed to have been much higher," the report said.
Estimates from Chinese researchers have put the actual number of residents at over 150 000, making Guangzhou home to the largest African community in Asia.
Police vans with flashing lights and officers astride motorcycles congregated after nightfall recently at a small public square in Xiaobei, a "Little Africa" neighbourhood with halal restaurants on narrow winding streets.
A Nigerian merchant was returning home from a meeting with wholesalers earlier this year when officers handcuffed him and hauled him to a police station because he was not carrying identification.
It was only after his Chinese landlord vouched for him over the phone that police allowed him to retrieve his passport in his apartment -- under close watch.
The treatment seemed "wrong" for a routine document check, the merchant told AFP on condition of anonymity.
Residents who faced police checks asked not to be identified over fears of being deported.
Guangzhou's police and exit-entry bureau did not return requests for comment.
"Sure, there are some illegal activities like the drug trade and police should target this minority of people," said Ohene Opoku Agyemang, a doctoral student in international relations at Jinan University.
"But the harsh treatment of law-abiding people negatively affects Africans' view of China and hurts efforts to build friendly relations with African countries," he said.
Long-time African residents of Guangzhou say they see their compatriots lapse into "illegal" status after struggling with onerous visa renewal requirements.
Nigerians must submit criminal record checks for all work and student visas, and no African countries are eligible for 72-hour or 144-hour transit visa exemptions, unlike visitors from many other nations.
"My friend had to go home to give fingerprints for a criminal record check. A return flight cost $2 000. By the time he got all his documents in order, his visa expired," said Akubakarr Sajor Barrie, director of an import-export company.
"For a small business owner, this is really hard. People start to wonder if doing business in China is worth it and they go to countries like Turkey and Vietnam instead," Barrie said.
In 2013, China amended its legislation governing foreign residents, the Exit-Entry Administration Law, adding higher penalties for illegal workers and overstayers without streamlining visa requirements, which vary widely between jurisdictions.
While the rules are for all foreigners, Africans lack institutional support in China and face considerable bureaucratic hurdles from their own countries, such as lacking online services for criminal record checks.
"There is no chamber of commerce from the 55 African countries in Guangzhou to track what is really happening or advocate for African businesses as other chambers of commerce do," said Hannah Ryder, CEO of Development Reimagined, an international development consultancy specialising in Africa-China relations.
A severe lack of funds and information prevents African governments from working together to seek favourable visa policies, she added.
The decrease of African residents in Guangzhou has taken a toll on Chinese businesses catering to them.
"We do flight bookings for traders, so when they can't get visas to come and visit even for a short time, of course it affects our business," said Yoyo Chen of Yoyo Travel Services.
But traders say some business conditions have improved.
"The quality and variety of choice in products has improved dramatically in the seven years I've been coming to Guangzhou," said a shoe merchant from Lagos, while he examined a bejeweled black velvet loafer at a market.
"And more Chinese can speak English."