LONDON — British and European Union officials reached a long-awaited draft agreement on Tuesday on Britain’s troubled withdrawal from the bloc, opening the way for a high-stakes meeting of Prime Minister Theresa May’s most senior ministers to consider the plans, the prime minister’s office said.

Cabinet ministers will have a chance to review the draft text before a critical meeting of the full cabinet at 2 p.m. Wednesday, the prime minister’s office said.

After months of deadlock over the terms of Britain’s exit from the bloc, the presentation of the draft agreement is a moment of truth for Mrs. May, who is desperate to avoid a chaotic and disorderly “no-deal” Brexit. But she cannot be assured of support from hard-line Brexiteers in her cabinet, whom she may need to face down.

[What is Brexit? A simple guide to why it matters and what happens next.]

In the worst case, defections from the cabinet or an outright rejection of the pact could threaten her leadership.