Berlin (AFP) - Worker-starved Germany will ease immigration rules to attract foreign jobseekers, including giving well-integrated, irregular migrants who are employed a shot at staying in the country, ministers said Tuesday.

In a deal hammered out after marathon talks deep into the night, Chancellor Angela Merkel's centre-right CDU party, their Bavarian allies CSU and the centre-left SPD agreed on a new strategy to combat fast-ageing Germany's worker shortage.

Migrants without residency permits who are awaiting decisions on their asylum applications or their deportation may get to stay if they are gainfully employed and can show they have joined the fabric of German society.

Jobseekers from outside the European Union -- including, for example, cooks, metallurgy workers or IT technicians -- can also come to Germany for six months to try to find employment, provided they speak German.

They would however have no access to Germany's social security system and must prove they are able to finance their stay.

Manpower from with the EU bloc of around 500 million people would not suffice to keep the German economy ticking, the coalition said.

"That's why we need workers from third countries," Interior Minister Horst Seehofer told a press conference about the strategy that has yet to be passed by parliament and become law.

At the same time, the ministers were at pains to stress the continued "separation of asylum and employment migration", mindful that Germany has been deeply polarised by the arrival of more than one million asylum seekers since 2015.

- 'Pragmatic solution' -

Immigration has become a hot-button issue in recent years over the record influx of mostly Muslim migrants, many fleeing war in Iraq, Syria and Afghanistan.

Railing against the newcomers, the far-right Alternative for Germany (AfD) has become Germany's biggest opposition party with more than 90 seats in the Bundestag.

The government ministers stressed that the new immigration rules are not designed to allow failed asylum applicants to gain residency in Germany by switching over to become employment migrants.

Story continues

Rather, the new rules are aimed at providing a "pragmatic solution" for migrants who, for instance, have been in Germany for a protracted period because they cannot be deported because they face the risk of torture in their country of origin.

A list of criteria would be drawn up for such cases, said the ministers.

It's a "pragmatic solution that reflects reality," said Employment Minister Hubertus Heil, adding that it would avoid cases of Germany "sending the wrong people back".

One of the AfD's leaders, Alexander Gauland, immediately accused the government of seeking to sow confusion among the population by mixing asylum and immigration.

The possibility of dodging expulsion has now been "greatly expanded," he charged.

With unemployment at a record low since reunification, companies in Europe's biggest economy have been complaining that a chronic shortage in workers is threatening growth.

In the areas of mathematics, computing, natural sciences and technology, a record 338,200 jobs went unfilled in September, reported business weekly Handelsblatt, quoting data from the Cologne-based German Economic Institute.

Economy Minister Peter Altmaier said the new rules will be of particular help to Germany's small- and medium-sized companies, "which in the past have suffered as they are in competition with big companies that have poached the well-trained people".