If the Democratic Unionist Party had swung behind May, it might have convinced many eurosceptic rebels within May's Conservative party to back her deal, but the DUP's move made it highly unlikely it would get through at a third attempt.
The DUP's decision now puts pressure on parliament to come up with a plan to prevent a "no-deal" Brexit on April 12, the new deadline set by Brussels last week.
"We will not be supporting the government if they table a fresh meaningful vote," the DUP said in a statement. Deputy party leader Nigel Dodds made clear in a tweet that this meant they would be voting against.
May's departure would not alter the terms of the Withdrawal Agreement, but it could give Conservative eurosceptics who have opposed it a greater say in negotiating the terms of Britain's future relationship with the EU.
"I have heard very clearly the mood of the parliamentary party," May told a meeting of Conservative lawmakers (MPs).
"I know there is a desire for a new approach – and new leadership – in the second phase of the Brexit negotiations – and I won't stand in the way of that."
If May does go, she will become the fourth Conservative prime minister in a row to have fallen foul of divisions over Europe within her centuries-old party, following David Cameron, John Major and Margaret Thatcher.
Many Conservative rebels who want a cleaner break from the EU had made clear they would only consider supporting her agreement if May, who voted to remain in the EU in the 2016 referendum, gave a firm commitment to resign.
May, who voted to remain in the EU in the 2016 referendum, had already promised to step down before the next election, due in 2022, but by offering to go sooner hoped to increase the chances of her Brexit deal passing.
May's deal, defeated in parliament by 149 votes on March 12 and by 230 votes on Jan. 15, means Britain would leave the EU single market and customs union as well as EU political bodies.
But it requires some EU rules to apply unless ways can be found in the future to ensure no border posts need to be rebuilt between British-ruled Northern Ireland and EU member Ireland.
Many Conservative rebels and the DUP object to this so-called Irish backstop, saying it risks binding Britain to the EU for years.
Jacob Rees-Mogg, who heads the ERG group of pro-Brexit Conservative lawmakers, said he would reluctantly vote for May's agreement but only if the DUP backed it or abstained.
An ERG spokesman said after the group held a meeting: "there is no way enough votes are coming out of that room to put the (Withdrawal Agreement) through".
To succeed, May needs at least 75 lawmakers to come over to her side.
If May's deal did pass, her office said there would be a contest to replace her after May 22 to provide new leadership for the next stage of Brexit.
Boris Johnson, former foreign minister, prominent eurosceptic and potential leadership candidate, was among those to have now swung round behind May's deal, the Times reported.
While May was addressing her lawmakers, MPs in the main chamber debated eight Brexit options ranging from leaving abruptly with no deal to revoking the divorce or holding a new referendum.
Lawmakers had voted on Monday to grab control of the Brexit process for a day in a bid to break the impasse. Several options would see much closer alignment with the EU than May envisages, including staying in the single market or a customs union.
In the "indicative vote", MPs were able to support as many proposals as they wished.
None of the proposals produced a majority, but the narrowest defeat, by just eight votes, was for a proposal to keep Britain in a permanent customs union with the EU.
Oliver Letwin, a 62-year-old Conservative former cabinet minister who led parliament's unusual power grab, said it was disappointing that no option had immediately produced a majority, but that this had been expected, and that parliament could try again to find that majority next Monday.
Britain was originally due to leave the EU on March 29 but last week the EU granted a postponement until April 12. The uncertainty around Britain's most significant political and economic move since World War Two has left allies and investors aghast.
Most voters think the negotiation has been handled badly and there may now be a slight majority for staying in the EU, recent polls suggest.
Many Conservative MPs say May herself has caused the chaos over Brexit by not negotiating harder with the EU.
"It was inevitable and I just feel she's made the right decision. She has actually read the mood of the party, which was a surprise," said Conservative lawmaker Pauline Latham.
May's offer to quit fails to sway key opponents of her Brexit deal