PARIS — French President Emmanuel Macron approved an immigration bill Wednesday that would sharply limit the number of asylum seekers allowed to stay in the country and at the same time increase deportations, infuriating migrant advocates and even political allies.

The bill, to be debated in Parliament in June, challenges the humane public image that Macron has sought to project: He once pointed to German Chancellor Angela Merkel’s embrace of 1 million migrants as an inspiring example of “our collective dignity.” Now his administration is making it easier for France to rid itself of unwanted migrants.

“He’s proclaiming he’s the hero of refugees, but in reality, this law does the opposite,” said Patrick Weil, a constitutional scholar and expert on immigration in France. “It makes it much more difficult for asylum seekers to actually receive refugee status. When you are a foreigner afraid for your life, you are not in the best position to deal with the kind of requests the government is demanding.”

Macron’s proposed legislation is mostly concerned with distinguishing between asylum seekers and economic migrants.

To that end, it seeks to shorten the asylum application process from roughly a year to six months.

It would also reduce the time a migrant has to appeal a government decision from a month to 15 days.

Most controversial, perhaps, is its proposed extension of detention periods.

At present, authorities are obliged to release detained migrants after 45 days. If the new law passes, migrants who have been refused asylum could be held for 90 days before deportation.

That is the provision that has outraged some members of Macron’s party, the centrist La République En Marche (“Republic on the Move”).

“We are in danger of normalizing locking people up,” Florence Granjus told Agence France-Presse.

Other party members have said much the same, and immigration now appears a major wedge dividing Macron’s unwieldy centrist coalition.

Those internal critiques echo statements last month from close advisers of Macron, including economist Jean Pisani-Ferry, a principal author of the president’s economic platform.

In an open letter to the Le Monde newspaper, Pisani-Ferry and others decried what they saw as a betrayal.

“Mr. Macron, your politics contradict the humanism that you preach,” the letter said.

The office of Interior Minister Gérard Collomb said in a statement Wednesday that the bill is meant to “strengthen the protections of people in a vulnerable state,” to “converge our procedures with European law and practice” and “adapt our law to operational realities.”

The government has also said that the legislation merely upholds campaign promises Macron has repeated from the beginning.

“The bill is completely balanced,” Collomb said in January. “It works on two guiding principles: France must welcome refugees, but it cannot welcome all economic migrants.”

For now, a majority of French voters appear to agree with Macron.

Approximately 63 percent think there are too many migrants in the country, according to a BVA opinion poll conducted this month.

In 2017, France saw a record 100,000 people file asylum requests, although the figure is far smaller than in some neighboring countries — especially Merkel’s Germany, which Macron often praises.

In 2017, Germany received 186,000 requests from asylum seekers. In 2015, it received 890,000.