Uriel Sinai, Getty Images
Israeli Foreign Minister Tzipi Livni, center, hugs a supporter at a polling station Wednesday. She is running for Israeli prime minister.

JERUSALEM — Israel's foreign minister won a narrow victory early today for the Kadima Party's leadership post, giving her the chance to be the country's first female leader in 34 years and sending a message that peace talks with the Palestinians will proceed.

The 50-year-old Tzipi Livni declared victory in the contest by a margin of 431 votes, besting former defense minister and military chief Shaul Mofaz.

Livni will replace Prime Minister Ehud Olmert as head of Kadima. Olmert, the target of a career-ending corruption probe, promised to step down as soon as a new Kadima leader was chosen.

The "national responsibility (bestowed) by the public brings me to approach this job with great reverence," said Livni, who now gets a chance to set up Israel's next government.

The victory declaration today came after official results showed Livni taking the race by a far narrower victory than polls had predicted. She barely edged out Mofaz. Israeli media reported that Mofaz called Livni to congratulate her, and rejected a legal adviser's proposal that he appeal the results.

Livni will have 42 days to form a new ruling coalition. If she succeeds, she will become Israel's first female prime minister since Golda Meir. If she fails, the country will hold elections in early 2009, a year and a half ahead of schedule.

Olmert will remain as a caretaker leader until a new coalition is approved by parliament.

Nationally, polls show Livni roughly tied with Benjamin Netanyahu of the hard-line Likud Party. A new nationwide vote would likely turn into a referendum on the current effort to forge a historic peace deal with the Palestinians.

"I am really happy that Livni won because she is committed to the peace process," said dovish Israeli lawmaker Yossi Beilin.

Foreign minister since 2006, Livni is Israel's lead negotiator in the peace talks and is a rare female power figure in a nation dominated by macho military men and a religious establishment with strict views on the role of women.

A former lawyer, army captain and one-time agent in the Mossad spy agency, Livni favors diplomacy over confrontation, even though she said last week that she has "no problem pulling the trigger when necessary."

A victory by Mofaz would have raised serious questions about Israel's involvement in peace talks with both the Palestinians and Syria. His approach is seen as far less conciliatory than hers. Had he won, the Iranian-born politician could have become Israel's first prime minister of Middle Eastern, or Sephardic, descent.