Germany introduced legislation Thursday to limit migrants’ access to its social safety net programs, German state news agency Deutsche Welle reported. The new welfare plan, coming from a government that said last year it could take in 500,000 refugees annually and called on other European governments to do the same, prevents German residents from accessing the country’s welfare program, known as Hartz IV, until after they’ve resided in the country for five years.

The bill also provides migrants who have no income with a month’s worth of rent and food money. But after that, until those five years are over, “the home country is responsible for paying the benefits,” and those migrating to Germany in search of work will have no welfare access, Deutsche Welle reported.

Labor Minister Andrea Nahles, the plan’s architect, was hailed for her cost-cutting and told the paper her legislation would improve “free movement of workers.” She did not, however, say whether there might be exceptions for migrants whose primary medical care and aid in their home countries came from nongovernmental organizations like Médecins Sans Frontières (Doctors Without Borders).

Critics, such as German Trade Union Confederation leader Annelie Buntenbach, responded vehemently to the law.

“People who are living in Germany and whose loss of the right of residence has not been bindingly established have the right to a secure, humane existence, regardless of their nationality ,” Buntenbach said in a statement to Deutsche Welles. She added that the Chancellor Angela Merkel’s cabinet “wants to sit and watch until [migrants’] poverty has set in before they can claim access to their rights.”

Germany surpassed the U.S. as the country that received and accepted the most asylum applications in 2013, according to the United Nations Refugee Agency. It was sixth on the list of European countries that had taken the most applications for asylum per capita in 2015, with just 587 per 100,000 people compared to front-runner Hungary’s 1,799.

Germany has also seen a rise in hate crimes committed against migrants, including instances of arson at refugee shelters, over the past couple of years.