Boris Johnson clinched a dramatic vote for his new Brexit plan, in the first demonstration that parliament is prepared to approve the broad principles of an agreement that takes the U.K. out of the European Union.

The government won by 329 to 299 votes in the House of Commons on Tuesday evening, paving the way for the next legislative stage, when Members of Parliament will be able to amend it. Before that, they will vote on whether to accept the prime minister’s accelerated timetable for the legislation to pass before Oct. 31.

After the chamber three times rejected the deal negotiated by Johnson’s predecessor, Theresa May, today’s vote is the first time the Commons has indicated it’s prepared to back a deal already negotiated with the EU. If Johnson is able to hold onto the slender majority as the legislation continues its passage through the Commons and then the House of Lords, he’ll able to fulfill his pledge to deliver Brexit.

It’s a remarkable turnaround for Johnson, who a month ago was found to have illegally suspended parliament, watched his brother quit the government and sacked 21 members of the Conservative Party for refusing to sign up to his no-deal stance.

He’s planning to push the so-called Withdrawal Agreement Bill through the Commons in just three days to avoid delaying Brexit for a third time. Some MPs who support debating the bill further may object to the accelerated timetable and switch sides.

Opponents argue the timetable is too short to debate such an important piece of legislation, which will have repercussions for trade, the economy and the union of Northern Ireland with England, Scotland and Wales. The government argues that most of the issues covered by the bill have been debated over the past three years in Parliament.

Johnson has said he’ll pull the bill if the timetable is rejected. He’s already been bounced into requesting a delay to Brexit by legislation passed against the government’s will, but made clear he doesn’t want that extension. If he can’t get the legislation through by Oct. 31, it’ll be in the hands of the EU to decide whether to grant the extension to Jan. 31 sought by Parliament or to opt for a shorter or longer delay. If the bloc refuses to do so, the U.K. will be on track to crash out of the EU without a deal on Oct. 31.