Moscow authorities have announced what they have called a "spring amnesty" for the hundreds of thousands of illegal migrants working in the city.
Far-right groups in Moscow have been protesting against migrants
From 1 March, illegal migrants will be able to apply to Russia's Federal Migration Service for registration.
On paying the equivalent of around $80 (£40), they will be given permission to search for work or a place to study.
If after a month they are still unemployed or not studying, they will be required to leave Moscow.
Officials say the amnesty is aimed at curbing the rise in xenophobic sentiment among the young.
It comes at a time when the Russian government is trying to bring order to economic migration by making it easier for workers to obtain the correct permissions, and by introducing tough sanctions for employers who take on illegal workers.
Permission to work
Many illegal migrants are likely to suspect the scheme is aimed more at detecting and then expelling them, rather than giving them full, legal status.
Moscow's authorities say that more than 1.7 million foreigners are registered in the city, and the numbers of new arrivals are increasing rapidly.
While no precise statistics are available, officials say that there may be another million or more illegal migrants working in the capital.
As unregistered inhabitants, they have no right to medical or social services, and are extremely vulnerable to both unscrupulous employers and far-right, racist groups.
Migrant workers "necessary"
Earlier this week, the head of the Federal Migration Service said migrant workers were as "necessary as air" to Russia's booming economy.
However, he warned, across Russia, there may be between five and seven million illegal migrants, whose position would need to be regularised.
The authorities, he pledged, would make it easier for migrants to gain the necessary permits.
But he warned employers of punitively large fines, if they take on illegal workers.
The largest numbers of foreign workers in Russia currently come from Uzbekistan, in Central Asia, and China.