The new leader of Israel's ruling Kadima party faces many challenges, but the first will be forming a government, writes Peter Hirschberg.
AFTER INITIALLY celebrating a series of exit polls that gave her an impressive 10- to 12-point victory in the primary race to replace prime minister Ehud Olmert as leader of the ruling Kadima party, Israeli foreign minister Tzipi Livni then spent a nail-biting, sleepless night as the real results trickled in through the early hours of Thursday morning and the margin in the race between her and transport minister Shaul Mofaz emerged as razor thin.
Ultimately, Livni won by just 431 votes, or 1.1 per cent of some 40,000 members (out of 70,000) of the centrist party who voted.
It won't be the last sleepless night Livni has to endure. The victory puts her on the doorstep of the prime minister's office. Should she become the second Israeli woman to inhabit that office - the first was Golda Meir more than three decades ago - she will face a series of daunting challenges.
In Gaza, Israeli security officials say Hamas is exploiting a fragile ceasefire to further arm itself. In Lebanon, where Hizbullah has become further entrenched, the Shia organisation is plotting to avenge the killing of one of its senior operatives earlier this year, for which it has blamed Israel.
Iran, which Israel believes is developing nuclear weapons, could present Livni with one of the most fateful decisions ever to confront an Israeli leader - whether to launch a military strike against Tehran's nuclear facilities.
If that's not enough, as prime minister one of Livni's first challenges will be to find ways to shield the Israeli economy against the economic tsunami that has wrecked major financial institutions and battered world markets in recent weeks.
But as she said in an ad hoc victory speech in front of reporters on a street outside her Tel Aviv home as dawn broke yesterday, her first challenge will be to cobble together a new ruling coalition.
To succeed, she will have to display the type of political guile and dexterity in navigating a fractious political system that has frustrated far more experienced politicians than herself.
The announcement last night by her opponent in the leadership race, Shaul Mofaz, a former chief of staff, that he was taking a time-out from politics, could also complicate her efforts to unite the party.
She wasted little time yesterday, meeting with Eli Yishai, the leader of the ultra-Orthodox Shas party, which has 12 seats and is a crucial piece in her coalition puzzle.
She will also have to ensure that the centre-left Labour Party, with 19 seats, remains in the governing coalition.
And she will try to draw in two pensioners' factions - the Pensioners Party split earlier this year - which together make up seven seats. Along with Kadima's 29 seats, that would give her a 67-seat majority in the 120-seat parliament.
After Ehud Olmert resigns in the coming days - his decision to step down in the face of corruption charges precipitated the Kadima leadership race - Livni will have up to six weeks to shape a new coalition.
Success could prove elusive: as a condition for joining any new coalition, Shas has already demanded that the future status of Jerusalem be off-limits in negotiations with the Palestinians. That could deter the centre-left Labour, which strongly supports talks with the Palestinians.
If Livni accedes to Shas's demand, it could also prejudice negotiations with the Palestinians, who have said that taking Jerusalem off the negotiating table is a non-starter.
Livni also knows that if she gets dragged into the type of horse-trading that is almost always a staple of coalition talks in Israel, she runs the risk of sullying the popular image she has crafted of herself as a crusader against sleaze.
If she finds herself struggling to square the demands of potential coalition partners, she could instead opt for an early general election, which would be held sometime early next year.
Livni is aware of the public's perception of her as a relative political newcomer, even though she has already held several ministerial posts since she entered politics nine years ago as a member of Likud. She might, therefore, prefer heading into an election from the lofty perch of the prime minister's office, especially since she will be up against two former prime ministers, the Likud's Benjamin Netanyahu and Labour's Ehud Barak, who will hammer away at what they believe is her Achilles heel - her lack of experience.