China is tightening control of its migrant population ahead of the Beijing Olympic Games this summer.
Millions of Chinese people have moved to cities looking for work
Chinese migrant workers will have to declare their political affiliations when registering for residency permits.
A human rights organisation said this is part of China's efforts to identify and drive out "unwanted people" from the capital before the games.
Correspondents say China wants to avoid embarrassing anti- government protests during the games.
Under new rules, migrant workers must give their political status when registering with local police, according to the state-run Xinhua news agency.
All migrant workers must register with local police when they move outside their home-towns to live elsewhere.
The new notice asks migrants to state whether they are party members, members of the Communist Youth League, ordinary citizens or members of non-communist parties.
In China there are eight of these other parties, although they are completely under the control of the Communists.
Xinhua said that registering migrants' political outlook would enable the police to better manage China's itinerant population.
Registration is supposed to be completed just before the Olympics begin in August.
In a related move, police have also organised random checks of people's identification cards at subway stations.
Human Rights Watch says Beijing's motive is clear.
"This kind of registration drive is part of Beijing's efforts to get rid of the capital's unwanted people ahead of the Olympics," said group researcher Nicholas Bequelin.
Staff at one Beijing police station said there had previously been a rule about registering migrants' political outlooks, but the practice had been dropped before the recent order asking them to restart it.
In the era of former leader Mao Zedong, a person's political status and family background could make a huge difference.
Members of the Chinese Communist Party, and members of workers' and farmers' families, enjoyed better prospects and benefits.