Macron rejected the offer from Interior Minister Gerald Darmanin to step down, instead ordering him to find new ways to break the deadlock and push the legislation through.
In a stunning setback for the government, the lower-house National Assembly adopted a motion to reject the controversial immigration bill without even debating it.
Prime Minister Elisabeth Borne was set to hold an emergency meeting involving several ministers and lawmakers on Monday evening.
After talks at the presidential Elysee Palace, Macron rejected Darmanin's offer to resign and asked him "to submit proposals to move forward by overcoming this blockage and obtaining an effective law", said a presidential official who asked not to be identified by name.
Originally proposed by Macron's centrist government with a mix of steps to expel more undocumented people and improve migrants' integration, the text of the bill leans firmly towards enforcement after its passage through the Senate, which is controlled by the right.
Speaking at the National Assembly, Darmanin defended the bill, which further restricts the ability for migrants to bring family members into France, birthright citizenship and welfare benefits.
He urged lawmakers not to join forces to vote on the rejection motion put forward by the Greens.
Despite his pleas, the National Assembly backed the motion to reject the bill by 270 votes to 265.
The move means the interruption of the examination of the legislation's roughly 2,600 proposed amendments.
The bill could now be sent back to the Senate, or the government could decide to withdraw the text.
"It is a failure, obviously," Darmanin told TF1 television. "I want to give the police, the gendarmes, the prefects, the magistrates the means to fight against irregular immigration."
He denounced what he called an "unholy alliance" of the left and far-right to vote the legislation down.
But far-right figurehead Marine Le Pen said she was "delighted" with the result, saying it had "protected the French from a migratory tidal wave".
"It feels like the end of the road for his law and therefore for him," hard-left leader Jean-Luc Melenchon said of Darmanin on X (formerly Twitter).
On Sunday, Macron said restricting the right of asylum would be a mistake as he spoke during a ceremony to mark the 75th anniversary of the Universal Declaration of Human Rights.
"France retains its long tradition of providing asylum for all those whose rights are threatened in their own country, and we will continue to defend this right of asylum," he said.
'Bill of shame'
The bill aims to speed up asylum application procedures and regularise the status of undocumented workers in sectors with labour shortages, but also to facilitate the expulsion of foreigners deemed dangerous.
It would introduce an annual quota for the number of migrant arrivals to be set by parliament, and remove all but emergency medical coverage for undocumented people.
Earlier in the day around 200 people including undocumented workers demonstrated outside the Palais Bourbon in Paris, which houses the National Assembly.
"We have gathered to denounce this bill of shame, which calls into question the fundamental principles of our republic," Sophie Binet, head of the hard-left CGT union, said at the rally.
She also denounced the "hypocrisy" of regularisations, saying "France could not function without undocumented workers in kitchens, cleaning and construction".
The passage of the bill is far from assured in the lower house, where no side has a majority.
It is unlikely to pass in any form without support from the conservative Republicans (LR) in the National Assembly.
The standoff has intensified speculation that the government will once again opt to trigger article 49.3 of the constitution, which allows it to pass legislation without a vote, as it did with contentious pension reforms earlier this year.
But the government wants to avoid wielding this widely unpopular constitutional hammer, which can also trigger a no-confidence vote.