The union leader Amir Peretz narrowly defeated the ageless dean of Israeli politics, Shimon Peres, for the leadership of the Labor Party on Thursday, promising a shift in the country's founding political movement toward its socialist roots and perhaps a swift departure from the coalition government now in power.

Peretz, who is head of the powerful Histadrut trade union association, won 42 percent of the vote to Peres's nearly 40 percent, according to final results announced early Thursday. A third candidate and former Labor leader, Binyamin Ben-Eliezer, took 17 percent of the ballots cast.

In his victory speech to jubilant supporters in Tel Aviv, Peretz, 54, promised to work on improving an economy that under Prime Minister Ariel Sharon has been guided by policies of lower public spending and open markets. He pledged a "new cycle of life" and a program in which "the economy serves man, man serves peace, and peace serves the economy."

"This morning, hope shines through," Peretz told the crowd at party headquarters,

Peretz's surprise victory -- polls showed Peres holding a double-digit lead heading into the Wednesday vote -- could shake up Sharon's fragile coalition government and advance general elections now scheduled for November 2006.

Peres, 82, brought the party into Sharon's coalition last year to support the Likud prime minister's plan to withdraw from the Gaza Strip after 38 years. But the decision angered some Labor members, even though the party is more dovish on matters of peace than Likud, because it was seen as propping up Sharon and keeping the rival Likud in power.

Peres's embrace of the Sharon government's economic policies has also angered many of the party's core supporters, who blame them for the rise in the number of Israelis living in poverty. The party was begun as secular socialist coalition by the founders of Israel.

Peretz is of Moroccan descent in a party whose leadership has long been dominated by Ashkenazis, or Jews of European descent.

Peres, a Nobel Peace Prize winner, called a news conference before dawn Thursday to complain about possible fraud in the balloting, saying he had "exceptional doubts" about the returns. He said he would ask the party to look into his claims.

"I expected a better evening," Peres said.