U.K. Prime Minister Boris Johnson was dealt two harsh rebukes in a showdown with Parliament this week over his plans to take a hard line in Brexit negotiations with the E.U.

First, a “rebel alliance” of opposition lawmakers and members of Johnson’s own Conservative Party voted Tuesday and Wednesday to make a “no deal” Brexit illegal. (Johnson has repeatedly said the U.K. will Brexit by the Oct. 31 deadline, no matter what.)

Johnson had pinned his short tenure so far on using the threat of crashing out of the E.U. without a deal––and the chaos and economic pain that’s likely to cause––to get the bloc to agree to more favorable terms.

When lawmakers––including respected former members of Conservative governments and Winston Churchill’s grandson––voted to take that option off the table, Johnson said the only option left was a general election.

Then, they denied him that, too. Late Wednesday, his bill to hold an early election on Oct. 15 failed to win over the two-thirds of lawmakers required, thanks to a 2011 law requiring a supermajority. Opposition lawmakers have said they will withhold their support until Johnson revealed his plan for an alternative Brexit deal––and until it was certain a “no deal” Brexit would not happen during or directly after the campaign.

Johnson had been pinning his hopes on public fatigue with Brexit. He bet it would help him unite the “leave” side of the British public and benefit from a split in the opposition “remain” camp––and ride what remains of his political honeymoon to victory on a “people versus Parliament” election.

“He’s basically appealing to one half of the electorate, i.e. those who voted leave and nearly all of whom would still vote to leave,” says Professor John Curtice of Strathclyde University, one of the U.K.’s most respected polling experts. “Of course, that section of the public is rather unhappy about the fact that it’s all taking so long.”

Curtice says that Johnson is hoping that by driving a hard line on Brexit, Johnson can win back defectors to the Brexit Party, uniting the “leave” vote, while benefiting from a split in the “remain” vote among the Labour Party and the Liberal Democrats, a smaller opposition party that has seen a recent revival in fortunes.

“But for the split in the ‘remain’ vote, Johnson wouldn’t have a dog’s chance of being able to win the election,” Curtice tells TIME, noting that the Conservatives’ 35% standing in voting intention polls is 10% down from the support Johnson’s predecessor Theresa May held just two years ago.

If Johnson is somehow able to muster to votes for a fresh election, Britain’s electoral system might be his savior. Under the “first past the post” system, voters get just one pick of candidates, and the lawmaker who receives the most votes in a constituency is sent to Parliament––even if that number is less than 50%.

In the Brexit context, with the U.K. split virtually down the middle between leave and remain, (53% of the country now supports “remain” and 47% “leave,” compared to 52% support for “leave” at the time of the Brexit referendum in 2016,) that means that whichever side can unite the vote around a single party will likely emerge victorious.

Despite all the setbacks he has received in recent days, Curtice says the Brexit math gives Johnson a chance. “It looks as though there’s a potential pathway to winning the election of being able to unite the ‘leave vote,’” he says. “Whereas the pathway for uniting the ‘remain’ vote seems to be much more difficult. In a single member plurality electoral system [like the U.K.], the united side is always going to win.”

The prime minister’s government was defeated by 328 votes to 301 on Tuesday and a similar margin on Wednesday, after an alliance of lawmakers from the opposition parties was joined by a 21-strong rebel contingent from the ruling Conservative Party.

After the first of the two defeats, on Tuesday night, Johnson expelled the 21 Conservative rebels from his party.

Such a move could also potentially force Johnson to go to the E.U. capital in Brussels to request a Brexit delay–– something he has repeatedly said he would never do.

The outcome of the parliamentary wrangling will be instrumental in how the upcoming election (a matter of when, rather than if, given Johnson’s minority in Parliament) plays out.

“It’s clear for the polling evidence that Johnson is much more likely to be able to win an election after Brexit,” says Curtice. But that outlook depends on whether Brexit has the negative effect on the economy many have predicted. “If the consequences of Brexit are fine, he’ll be fine,” Curtice tells TIME. “If the consequences of Brexit are not so good, payback time will begin to kick in.”

Write to Billy Perrigo at billy.perrigo@time.com.