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 Thursday 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 had needed 40 percent of the vote to avoid a runoff next week.
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. "I think the right thing for her to do now is to form a coalition that wants to promote peace rather than a broad government with the right."
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.
Two other candidates, Cabinet minister Meir Sheetrit and former Shin Bet security service director Avi Dichter lagged far behind in the polls.
Joyce Amiel, a Kadima supporter in Tel Aviv, said she was voting for Livni "mainly because she is a woman, even though her positions are not clear. We think she would do the best job. We want her to win."
Casting her vote in Tel Aviv, the usually reserved Livni bubbled with uncharacteristic enthusiasm. She said she was pleased with the turnout at her polling station and urged people to vote.
"You can determine today what the character of Kadima will be," Livni said. "You can determine today if you really have had enough of old-time politics. Come and vote, bring your children, and show them how you are changing the country."
Palestinian Information Minister Riad Malki was hopeful that peace talks could succeed under Israel's new leadership.
"We welcome the results of the election, and we are going to deal with any new prime minister in Israel," he told The Associated Press. "We hope this new prime minister will be ready to ... reach a peace deal with the Palestinians that ends the occupation and allows the establishment of an independent Palestinian state living beside Israel."
The primary was Kadima's first since the party was founded by then-Prime Minister Ariel Sharon in 2005. Sharon suffered a debilitating stroke in early 2006, and Olmert subsequently led the party to victory in elections.
Sharon set up Kadima as a personal bastion after his hard-line colleagues in Likud blasted his unilateral pullout from the Gaza Strip in 2005. It was widely predicted Kadima would disintegrate after his exit, but the moderate Livni's victory appeared to give it a chance of survival.
Olmert is under police investigation over his financial dealings. But he has been pursuing peace talks with the Palestinians and has pledged to continue as long as he is in office.
However, both he and his Palestinian counterparts now say they are unlikely to reach the U.S.-set target date of year's end for a final peace deal. Also, any agreement they might reach would not be implemented until Abbas regains control of the Gaza Strip, overrun by Islamic Hamas militants in June 2007.
Israeli political science professor Gadi Wolfsfeld predicted Livni could use a peace deal to win a national election.
"If she comes to a tentative agreement with the Palestinians, why not run on that platform, which would be very good for her?" he said.