Foreign Minister Tzipi Livni was set to be Israel's next prime minister after victory in a party leadership election to choose a replacement for Ehud Olmert.
Exit polls showed Ms Livni cruising to a big win but party officials said the final margin over Shaul Mofaz, a former general who is now transport minister, was just over 1%. She was 431 votes ahead.
"The good guys won," Ms Livni, a former Mossad intelligence agent, told supporters within the ruling centrist Kadima party.
"Tomorrow, I will begin meeting with representatives of the factions in order to form quickly a coalition that can deal with all of these challenges that lie ahead," the 50-year-old said.
"On the level of government in Israel, we have to deal with difficult threats," she said.
Palestinian peace negotiators - and possibly the sponsors of the peace process in Washington - were among those applauding as official results began to confirm a win for Ms Livni, who has led talks with the Palestinians this year.
But the daughter of storied Zionist guerrilla fighters of the 1940s will require combative spirit and political flair to consolidate her goal of becoming Israel's first woman leader since the redoubtable Golda Meir in the 1970s.
Mr Olmert, who telephoned Ms Livni with congratulations, has said he will resign as soon as Kadima has a new leader. But the outgoing premier, who could be indicted for corruption, has also vowed to exercise his right to stay on in a caretaker capacity until Ms Livni forges her own, new coalition government.
That process, involving deals with ambitious Labour party leader Ehud Barak on the left and influential Jewish religious parties on the right, could take weeks or months. Many believe there may yet be an early parliamentary election, which polls show Benjamin Netanyahu's right-wing Likud would win.
"You were just incredible," Ms Livni said in a conference call to supporters that was broadcast on Army Radio. "I just want afterwards not to disappoint any of you and to do all the right things that you fought for."
Aides for Mr Mofaz said he had no plans to speak until Thursday and would not concede defeat until the final results were confirmed.
Exit polls by two Israeli broadcasters gave Ms Livni 47% to 49% of votes cast on a turnout of about half of Kadima's 74,000 members. That was comfortably ahead of Mr Mofaz on 37% and well above the 40% threshold needed to avoid a runoff second round.
Kadima, founded in 2005 by then premier Ariel Sharon, has just a quarter of the seats in the Knesset. Rivals, some within Mr Olmert's coalition, are preparing for a national election battle well ahead of the next scheduled parliamentary vote in 2010.