Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — For the second time in as many months, British lawmakers rejected Prime Minister Theresa May’s divorce deal with the European Union.

Tuesday's defeat came only 17 days before the United Kingdom is due to leave the 28-country bloc.

It also casts doubt on whether Britain's departure will occur as scheduled — or even at all.

Lawmakers rejected her deal 391 to 242, which was similar to the previous vote.

Britain's Prime Minister Theresa May speaks in Parliament on Tuesday. Reuters TV

On Jan. 15, May suffered the biggest parliamentary defeat of any British prime minister in history as more than one-third of lawmakers from her ruling Conservative Party voted against her proposal to leave the E.U. Only 202 lawmakers overall supported her plan in that humiliating vote, with 432 rejecting it in Parliament.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Earlier Tuesday, she laid out the potential consequences of defeat.

“If this vote is not passed tonight, if this deal is not passed, then Brexit could be lost,” a hoarse May said in Parliament.

Last week, she promised lawmakers that if the deal were to fail for a second time, they would then have the opportunity to vote on the way forward.

They are now set to decide in the next few days whether to leave the E.U. without an agreement — an idea likely to be rejected due to its potentially devastating economic impact — or to ask the E.U. to delay Brexit beyond the scheduled March 29 departure date.

May spent almost two years negotiating her withdrawal agreement with the E.U.

The main sticking point in the deal for many lawmakers is an insurance policy designed to keep open the border between Northern Ireland, which is part of the U.K., and the Republic of Ireland, which will remain part of the E.U.

Since the first failed vote, May has worked with the E.U. to clarify how the so-called Irish backstop would work. Brexit supporters fear that the backstop could be used to bind the country to E.U. regulations indefinitely.

On Monday, May made a last-minute visit to Strasbourg, France, for talks with European Commission President Jean-Claude Juncker. She had hoped that what she called “legal changes” to the backstop would be enough to convince reluctant lawmakers to vote for her deal.

By Tuesday afternoon, it became increasingly clear that her second vote would also fail.

Attorney General Geoffrey Cox said May's changes to her plan reduced the risk Britain could be trapped inside E.U. regulations — but didn't eliminate it. Then, both the influential pro-Brexit faction of lawmakers in May's party and her coalition partners from Northern Ireland said they would not vote for her deal.

If Parliament fails to act, then Britain will leave the E.U. without an arrangement for its future trading relationship. Businesses have warned that there could be gridlock at British ports as a result of customs checks and shortages of fresh produce.

In the long run, the government says a no-deal scenario would leave the economy 6 percent to 9 percent smaller over 15 years than remaining in the E.U.