Pundits have consistently underestimated British Prime Minister Boris Johnson.

Just a few short months ago, their consensus was that the European Union would not reopen the withdrawal deal it had agreed upon with former prime minister Theresa May, even though the agreement had been rejected three times by the U.K. Parliament. Commentators, again and again, said that a prime minister threatening to leave the E.U. with or without a deal by the Oct. 31 exit date would not change the E.U.’s calculations. Indeed, people claimed a change in prime minister itself would alter nothing.

But, as it so often has been in recent years, conventional wisdom was wrong. On Thursday morning, the E.U. and British government announced a fresh withdrawal agreement, stripping away aspects of May’s “backstop” proposal for the border between Northern Ireland and the Republic of Ireland that had most worried Brexiteers.

Now, rather than risking the whole country being locked into a customs union with the E.U. until the latter agreed otherwise, Britain will once again have its own full, independent trade policy. Negotiations on so-called “level playing field regulations” for the environment and social policy have been pushed into stage two talks for a Britain‑E.U. free-trade agreement, too. In essence, Johnson has negotiated an exit agreement that points toward a much looser future trade relationship, with more trade and regulatory autonomy for the United Kingdom.

Avoiding a hard border between Northern Ireland and Ireland required compromise on both sides. Rather than keeping the whole United Kingdom in the E.U.’s customs orbit, the new deal would place customs checks on goods flowing between Great Britain and Northern Ireland, and Northern Ireland would effectively remain in regulatory alignment with the E.U. on goods and agricultural products to avoid in-Ireland regulatory checks. Crucially though, a tariff-rebate system will mean Northern Ireland is still subject to Britain’s full independent trade policy. And there is an exit mechanism for Northern Ireland should this dual arrangement become intolerable. After four years, its assembly will be able to decide its fate by majority vote. This all means a need for border checks is avoided, and there is a meaningful consent mechanism for the people of Northern Ireland.

Whether such a deal can obtain the necessary majority in Parliament on Saturday is an open question. Two big factors will determine its success: the position of E.U. leaders and the political calculation of Brexit-respecting Labour Party members of Parliament.

If Johnson can convince other European heads of state to credibly commit to reject any further extension of the Brexit withdrawal process, then British MPs will, in principle, face a stark choice: this deal or no deal on the current exit date of Oct. 31.

European Union President Jean-Claude Juncker has tipped his hat in this direction, but it’s not for him to decide. So far, Johnson’s opponents have convinced themselves that if they defeat his deal, they will trigger the so-called Benn Act, which would compel the prime minister to write a letter to the E.U. seeking a further extension. At that point, they say, E.U. heads of state will certainly accept it, rather than kicking Britain out against Parliament’s wishes. But if French President Emmanuel Macron strongly suggested otherwise (he even wavered on the last extension), it could well tip the balance, with MPs unwilling to contemplate a no-deal scenario.

If not, the parliamentary arithmetic looks very tight. May’s last attempt at getting her deal through Parliament was defeated by a margin of 58 votes, which means Johnson needs a net swing of 30 votes to get a majority. He can probably count on the vast majority of the 286 MPs who voted for May’s deal the last time around, but may lose up to 10 (pessimistically). Because of the changes to the deal, he then will probably gain between 20 and 25 of the Conservative rebels who voted against May’s deal. That leaves him requiring about 15 Labour MPs to break ranks with their party’s leadership.

From a Labour perspective, Johnson’s new deal is probably worse than May’s for its interests, with less firm guarantees about employment and environmental rights. Labour leader Jeremy Corbyn’s team is already making noises that any MP who votes for it will be expelled from the party. That will, undoubtedly, crush some dissent. But with the Conservatives flying above Labour in the polls, and Johnson now being seen as trying to leave the E.U. in an orderly manner, some may realize that they will look ridiculous voting against this deal, when they previously said their overwhelming aim was to stop a no-deal exit. Blocking Brexit will be electorally disastrous in certain northern Leave constituencies, and one Labour cohort has strongly implied they were wrong to vote against the deal last time.

Saturday’s vote will therefore be extraordinarily tense. But this week’s events have shown Johnson and his team to be nimbler and more politically savvy than commentators believed. Underestimate him again at your peril.