The campaign to lead the party come down to a straight fight between David, left, and Ed Miliband, right [AFP]

Britain's opposition Labour Party has elected Ed Miliband, the former energy secretary, as its new leader after a cliffhanger vote held at the party's annual conference in Manchester.

Miliband defeated David, his older brother and former foreign minister, in Saturday's poll by a wafer-thin margin to take over the helm of the centre-left party.

The 40-year-old succeeds Gordon Brown, the former prime minister, who resigned after the party lost a general election in May election, ending 13 years of Labour rule.

Miliband won by a majority of 50.65 per cent against 49.35 per cent for his brother David, 45, who had been in the lead until the final days of the campaign.

The younger Miliband's victory came after second, third and fourth preference votes came into play.

Ed Balls, the former education minister, was third, Andy Burnham, the former health minister, was fourth and Diane Abbott was last, in the ballot of MPs, members and trade unionists.

In his victory speech, Miliband said: "David, I love you so much as a brother and I have such extraordinary respect for the campaign that you ran, the strength and eloquence that you showed.

"I have to unify this party and I will. Today the work of the new generation begins."

'Extraordinary day'

Reacting to the result, Balls said: "We are going to unite around Ed. I hope we are not going to hear noises after the next 48 hours.

"Ed Miliband is our leader. I'm backing him, I'm sure everybody else wants to do that as well. He'll be very good for the country."

David Cameron, the British prime minister, said: "Congratulations to Ed Miliband. I was leader of the opposition for four years and know what a demanding but important job it is. I wish him and his family well."

Nazanine Moshiri, Al Jazeera's correspondent in Manchester, said: "It was an extrordinary day in British politics, two Milibands with two differing visions.

"In the end, Labour voted with its heart rather than its head, choosing the younger, less experienced sibling, Ed Miliband.

"Ed Miliband's first test will be a response to the coalition government's spending cuts, due to be announced in a few weeks time.

"He'll have to rebuild a defeated party and convince British voters to come back to Labour."

Source: Agencies