Beijing authorities have launched a 100-day crackdown on foreigners who stay or work in the city illegally.
Local police said those who entered China illegally, overstayed their visas or worked without proper permits would be punished.
Officers would conduct visa checks in places across the city that were popular for foreigners, police said.
Beijing has become increasingly attractive to foreigners as the Chinese economy has boomed.
The crackdown will continue until the end of August, police said.
Local media report that areas to be targeted include the bar district of Sanlitun and areas around university campuses.
Posting on its official microblog site , Beijing police said common offenders included international students who picked up work in violation of their visa conditions.
The police urged local people to provide information on illegal immigrants.
It is not clear what prompted the move. State media said 13,000 illegal overstayers and workers had been reported in the capital in the last four years, citing official figures.
A public security bureau spokesman, quoted in China Daily, said it was not linked to video footage - watched by millions on the internet - showing the alleged attempted indecent assault of a Chinese woman by a British visitor in Beijing.
A bilingual editorial in the Global Times urged the Chinese government to take swift action against illegal immigrants but warned that "mishandling this problem may lead to diplomatic friction".