The law approved by the National People's Congress Standing Committee now requires foreigners to obtain valid documents—including employment certificates—to work in China, Xinhua said.
It allows for employers to be fined 10,000 yuan ($1,580) for every foreigner they hire illegally, Xinhua said.
Authorities encourage Chinese citizens to report clues regarding foreigners who may work in China illegally and ask universities and language schools to share the employment information of their students, Xinhua said.
For at least a decade, foreigners on short-term visas have managed to live and work in China for extended periods of time by dashing to the border and renewing their temporary permits such as tourist visas repeatedly.
Sometimes Chinese employers consider it a hassle to apply for work visas for their foreign workers.
Vice public security minister Yang Huanning was quoted in the Xinhua report as saying the number of foreigners working in China tripled in the last 11 years.