LONDON (AP) — The executive of Britain’s divided Labour Party went to court Thursday in a bid to prevent tens of thousands of new members from voting in the party’s leadership contest.

The country’s main opposition party has descended into turmoil, with moderates and leftists exchanging abuse and lawmakers trying to unseat leader Jeremy Corbyn. The party’s more centrist members consider, Corbyn, a 67-year-old left-winger, unelectable.

He is facing a challenge from legislator Owen Smith in an election that will be decided by party members and supporters next month.

The party ruled that only members of at least six months’ standing could vote in the contest. Five Labour members challenged the decision, and on Monday a judge ruled that the party was wrong to retroactively impose a cutoff date.

Party general-secretary Iain McNicol asked the Court of Appeal on Thursday to overturn the judgment, which affects almost 130,000 new Labour members — many of them thought to support Corbyn.

McNicol’s lawyer, Clive Sheldon, argued that “the learned judge below got it wrong.”

Corbyn, who was elected a year ago, retains strong support among party members. But most Labour lawmakers accuse him of failing to present a compelling alternative to the Conservative government and of showing half-hearted support for European Union membership during Britain’s recent referendum campaign. They also accuse far-left activists among his supporters of intimidating more centrist party members.

The appeals court is due to give its ruling on Friday.

The winner of the leadership contest will be announced Sept. 24.