LONDON -- The U.K. and the European Union plowed ahead Monday with plans to have their divorce deal signed, sealed and delivered within days as British Prime Minister Theresa May waited to see whether rebel lawmakers opposed to the agreement had the numbers to challenge her leadership.

The draft agreement reached last week triggered an avalanche of criticism in Britain and left May fighting to keep her job even as British and EU negotiators raced to firm up a final deal before a weekend summit where EU leaders hope to rubber-stamp it.

The 585-page, legally binding withdrawal agreement is as good as complete, but Britain and the EU still need to flesh out a far less detailed seven-page declaration on their future relations.

May said "an intense week of negotiations" lay ahead to finalize the framework.

The deal has infuriated pro-Brexit lawmakers in May's Conservative Party. The Brexiteers want a clean break with the bloc and argue that the close trade ties called for in the agreement May's government agreed would leave Britain a vassal state, bound to EU rules it has no say in making.

Two Cabinet ministers, including Brexit Secretary Dominic Raab, resigned in protest, and rebels are trying to gather the signatures of 48 lawmakers needed to trigger a no-confidence vote.

One pro-Brexit Conservative lawmaker, Simon Clarke, urged wavering colleagues Monday to join the rebellion, saying "it is quite clear to me that the captain is driving the ship at the rocks."

Even if May sees off such a challenge, she still has to get the deal approved by Parliament. Her Conservatives don't have a parliamentary majority, and whether she can persuade enough lawmakers to back the agreement is uncertain.

It is also unclear what would happen if Parliament rejected the deal when it is put to a vote, likely next month.

May's government relies for survival on the votes of Northern Ireland's Democratic Unionist Party, which struck a deal last year to back the Conservatives on major legislation, including finance bills. But the DUP opposes the Brexit deal's plans for keeping the border between the U.K.'s Northern Ireland and EU member Ireland open after Britain leaves the bloc.

In a warning to May, DUP lawmakers abstained Monday during several votes on the government's finance bill.

May argues that abandoning the plan, with Britain's March 29 departure date just over four months away, could lead to Brexit being delayed or abandoned, or to a disorderly and economically damaging "no deal" Brexit.

But opposition Labour Party leader Jeremy Corbyn said his lawmakers would vote against May's agreement and also try to block a "no-deal" exit.

The agreement also must be approved by the European Parliament. Manfred Weber, who leads the EU legislature's largest group, said the initial assessment of the centre-right European People's Party was "very encouraging, very positive."

But, he added, "it must be clear to our British partners that there will be no renegotiation of this text that is now on the table."

Luxembourg Foreign Minister Jean Asselborn said the deal "is the best one possible."

"There is no better one for this crazy Brexit," Asselborn said as EU foreign ministers met in Brussels before the Sunday summit of member country leaders at which the bloc intends to sign off on the deal.

Most contentious negotiating issues have been resolved, but Spain insisted at the Brussels meeting that it needed more clarity on how Gibraltar, the British territory at the southern tip of the Iberian peninsula, would be dealt with.

EU chief negotiator Michel Barnier said the EU foreign ministers "have agreed to the principle" of a one-off extension of the post-Brexit transition period if the two sides need more time to finalize a trade deal.

Under the divorce agreement, Britain would be bound by EU rules during the transition. It is due to end in December 2020 but can be extended by mutual agreement if more time is needed.

Barnier wouldn't give a specific end-date for the extension. It's a delicate issue for May, because some in her party worry the extension could be used to trap Britain in the EU's rules indefinitely.

May says any extension must be finished before the next U.K. election, scheduled for the first half of 2022.

May tried to build public and business support for the deal on Monday, telling business lobby group the Confederation of British Industry that it "fulfills the wishes of the British people" to leave the EU, by taking back control of the U.K.'s laws, money and borders.

May confirmed the government's plan to end the automatic right of EU citizens to live and work in the U.K., saying Britain's future immigration policy will be based on skills, rather than nationality.

She said EU nationals would no longer be able to "jump the queue ahead of engineers from Sydney or software developers from Delhi" -- a phrase that risked further upsetting EU citizens in Britain, who have faced more than two years of uncertainty about their future status.

British businesses, longing for an end to uncertainty about what rules they will face after Brexit, have broadly welcomed the agreement. But some are unhappy with the immigration plans, which have yet to be revealed in detail.

Carolyn Fairbairn of the Confederation of British Industry urged the government not to make "a false choice between high- and low-skilled workers" that would leave many sectors short-staffed.

May said she was confident the deal "will work for the U.K."

"And let no one be in any doubt - I am determined to deliver it," she said.

In Brussels, Austria's minister for Europe, Gernot Bluemel, struck a more melancholy tone.

"A painful week in European politics is starting," he said. "We have the divorce papers on the table; 45 years of difficult marriage are coming to an end."

------

Raf Casert reported from Brussels.