Former Israeli Prime Minister Ehud Barak has been elected leader of the Labour Party, the second major partner in the country's governing coalition.

Mr Barak won 51.2% in the second-round run-off, while former intelligence chief Ami Ayalon gained 47.7%. The remaining ballots were spoilt.

Incumbent Amir Peretz, who was heavily criticised after the 2006 Lebanon war, was knocked out in the first round.

Mr Barak has called for PM Ehud Olmert to resign over his handling of the war.

However, correspondents say he is unlikely to bring down the coalition led by Mr Olmert's Kadima party, as opinion polls indicate the right-wing opposition party, Likud, would be likely to win in the event of a general election.

Comeback

Speaking to his supporters in Tel Aviv after the results had been confirmed, Mr Barak said he would focus on re-building trust in Israel's government.

Today begins the long journey toward bringing back level-headed, responsible, and experienced leadership to the state of Israel

"Today begins the long journey toward bringing back level-headed, responsible, and experienced leadership to the state of Israel," he said.

"It is also the beginning of our mission to repair the people's faith in its leaders."

Mr Barak, Israel's most decorated soldier, also announced he would replace Mr Peretz as defence minister and lead reforms in the Israel Defence Force (IDF).

"I promise to put all my efforts and my knowledge into strengthening the security forces and the IDF and into restoring our military might and Israel's power of deterrence," he said.

The new Labour chairman added that his party's policy would combine "uncompromising security, protecting Israel's solidarity and democracy, determined pursuit of real peace, reinforcement of the rule of law and healing the Israeli society".

Mr Barak said the internal rivalry within Labour was now over.

"I was chosen to lead the mission, but I plan to do it with the wonderful team, along with Ami [Ayalon] and all the other comrades," he said.

Mr Ayalon, a former head of Shin Bet, Israel's internal security agency, promised to work together with Barak and not to appeal against the results.

The BBC's Sebastian Usher says Mr Barak has made a remarkable comeback.

He has been in the political wilderness for the past six years since losing the 2001 general election, our correspondent adds.

His defeat followed 19 months as prime minister, during which he tried but failed to achieve a comprehensive peace deal with the Palestinians.