Britain's opposition Labour Party won a parliamentary seat in northern England with an increased share of the vote, a relief to the party's new leader, Jeremy Corbyn, in his first electoral test.

Left-winger Corbyn has split Labour since his election as leader less than three months ago, prompting infighting that threatens to tear the party apart.

Labour won the vote in Oldham West and Royton, triggered by the death of the incumbent lawmaker, with 17,322 votes. Its main challenger, the anti-European Union United Kingdom Independence Party (UKIP), came second with 6,487 votes.

"The result is quite staggering," said newly elected Labour lawmaker Jim McMahon, who had focused his campaign on his four years leading the local council in what some said was a move to distance himself from Labour turmoil in London.

Labour has held the seat for decades and in May's national election, it won it with a majority of more than 14,000. While its majority was reduced to 10,835 on Thursday this was in large part due to a lower turnout and the party increased its share of the vote by more than seven percentage points from May.

Corbyn hailed the result, which was better than many pundits had predicted, as a "vote of confidence" in Labour.

"It's a clear demonstration that Labour is the party working people trust," he said in a statement. "This first electoral test in the new parliament has made clear Labour is the real alternative for Britain."

During the campaign, UKIP had sought to highlight Labour's lack of unity on security, warning Corbyn's pacifism would leave Britain undefended from attacks by Syria-based Islamic State militants.

Voting in the former industrial town outside Manchester took place a day after 66 Labour lawmakers, including some in his senior team, rebelled against Corbyn to back the government on extending British air strikes to Syria.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.