British Prime Minister Rishi Sunak’s emergency bill to revive his plan to send asylum seekers to Rwanda avoided defeat in parliament on Tuesday, surviving a rebellion by dozens of his lawmakers that has laid bare his party’s deep divisions.

Sunak, who has pinned his reputation on the strategy despite warnings at every stage that it would not work, won the first vote on the plan in the House of Commons by 313 to 269 after a day of last ditch negotiations and drama in parliament.

Despite the victory, the result showed the prime minister is struggling to maintain control over his party. Moderate Conservatives say they will not support the draft law if it means Britain will breach its human rights obligations, and right-wing politicians say it does not go far enough.

In power for 13 years and trailing the opposition Labour Party by around 20 points with an election expected in January 2025, Sunak’s Conservatives have fractured along multiple lines and lost much of their discipline.

“We have decided collectively that we cannot support the bill tonight because of its many omissions,” said Mark Francois, speaking on behalf of some right-wing Conservative lawmakers. They said they would abstain rather than support Sunak.

All Conservative lawmakers had been ordered by those in charge of party management to back the bill, and the abstentions were a foretaste of likely further rebellions at the next stages of the parliamentary process.

“Let’s pick this up again in January. We will table amendments and we will take it from there,” Francois said, saying the grouping of about 40 right-wing lawmakers reserved the right to vote against the legislation at a later date.

In a sign of how uncertain Sunak was about the result, Britain’s climate change minister Graham Stuart left the COP28 summit in Dubai to return to vote in parliament, despite critical climate negotiations still going on.

The prime minister was forced to indicate to would-be rebels during a breakfast meeting in Downing Street that they could amend the legislation later in an attempt to encourage them to back down from a revolt that would have killed the bill.