With 99 percent of the votes counted, Livni's centrist Kadima Party had 28 seats in the 120-seat parliament while Netanyahu's hawkish Likud Party was right behind with 27, according to unofficial results from Israel's election committee. The tally did not count thousands of votes by soldiers, to be counted Thursday.
Overall, hawks appeared to have won a clear majority of 65 seats, giving Netanyahu the upper hand in forming the next government.
However, Livni could try to persuade hawkish parties to join her - and it appeared one ultranationalist candidate in particular, Avigdor Lieberman, could single-handedly determine the country's next leader.
CBS News correspondent Richard Roth reported that even though Netanyahu has fewer votes, he has a bigger bloc of potential right-wing allies that could form a coalition government. Political wrangling will now decide who really won, says Roth.
Whoever comes out on top, the political wrangling following Tuesday's vote was likely to drag on for weeks, with the fate of international Mideast peace efforts in the balance.
A win by Livni, who favors giving up land to make room for a Palestinian state, would boost the Obama administration's goal of pursuing an Israeli-Palestinian peace deal. A government led by Netanyahu, who opposes concessions to the Palestinians, could put Israel and the U.S. on a collision course.
"With God's help, I will lead the next government," Netanyahu told a raucous crowd of cheering supporters chanting his nickname, Bibi. "The national camp, led by the Likud, has won a clear advantage."
Soon after, Livni took the stage before a crowd of flag-waving supporters and flashed a V-for victory sign. "Today the people chose Kadima. ... We will form the next government led by Kadima."
Earlier, exit polls showed Livni with a slight lead, but strong gains by right-wing parties overall would make it difficult and perhaps impossible, for her to form a government.
Even if Livni could overcome the formidable obstacles and become Israel's second female prime minister after Golda Meir, she would almost certainly be hindered by right-wing coalition partners opposed to her vision of giving up land in exchange for a peace deal with the Palestinians.
Nevertheless, applause, cheers and whistling erupted at Kadima headquarters in Tel Aviv as television stations began reporting their exit polls, with supporters jumping up and down and giving each other high-fives and hugs.
In his speech, Netanyahu told his supporters that he was proud of the gains by his hard-line party. He called for a broad-based coalition, but said he would first turn to his "natural partners in the national camp," a reference to other hard-liners opposed to peace concessions.
The partial results marked a dramatic slide for Netanyahu, who had held a solid lead in opinion polls heading into the election. Still, the overall results showed hard-line parties winning 64 seats in the 120-member parliament, while more dovish parties captured just 56 seats.
Soldiers' votes on bases around the country won't be tallied until Thursday evening, and that could shift the results by a seat or two.
Israelis vote for parties, not individuals. Since no party won a parliamentary majority, the leader of one of the major parties must try to put together a coalition with other factions - a process that can take up to six weeks.
In coming days, President Shimon Peres will ask the leader who he believes is most capable of forming a coalition to try to put together a government.
If he chooses Livni, it would be her second try in four months. The election was called after she failed to put together a ruling coalition when scandal-plagued Prime Minister Ehud Olmert announced he was stepping down last fall.
Alternatively, Peres could turn to Netanyahu, who appeared to be in a better position to put together a majority.
Netanyahu, who opposes giving up territory for a Palestinian state, could find himself on a collision course with President Barack Obama, who is promising an aggressive push for Mideast peace. Netanyahu says he would allow West Bank settlements to expand and is seen as likely to contemplate military action against Iran - positions that would likely put him at odds with Obama.
If Livni's projected victory holds, it is likely due to a strong showing by Lieberman, who appears to have taken a sizable chunk of votes that would have otherwise gone to Netanyahu.
The partial results gave Lieberman's Yisrael Beitenu Party 15 seats, placing it in third place behind Kadima and Likud - and ahead of Labor, the party that ruled Israel for decades. That gives Lieberman, who based his campaign on denying citizenship to Israeli Arabs he considers disloyal, a key role in coalition building.
Lieberman said his party's strong showing means he holds the key to forming the new Israeli government. He said he had spoken to both Livni and Netanyahu and told them he could be persuaded to join either one of them.
"It is up to Lieberman who will form the next coalition," said Menachem Hofnung, a professor of political science at Hebrew University. "Lieberman has emerged as the kingmaker. He is the winner of this election, and it depends on who he sides with over the next few weeks as to who will be prime minister."
Netanyahu, who was prime minister a decade ago, portrayed himself as the candidate best equipped to deal with the threats Israel faces - Hamas militants in Gaza, Hezbollah guerrillas in Lebanon and behind them an Iranian regime that Israel believes is developing nuclear weapons.
He has derided the outgoing government's peace talks as a waste of time, and said relations with the Palestinians should be limited to developing their battered economy.
Livni, who has led Israel's peace talks the past year, has pledged to continue the negotiations with the moderate Palestinian government in the West Bank. At the same time, she advocates a tough line against the Hamas regime in the Gaza Strip, and was one of the architects against a bruising Israeli military offensive in Gaza last month.
At Likud headquarters, activists dismissed Kadima's edge and predicted Netanyahu would be tapped to form the next government.
"I am certain that Netanyahu will be the next prime minister," said Likud lawmaker Gilad Erdan. "Netanyahu has a clear advantage because the right-wing parties have a larger bloc. The test is not which party gets the most votes, but which candidate has the best chance to form a coalition, and that person is Benjamin Netanyahu."
Kadima lawmaker Haim Ramon predicted his party would lead the next government.
"We are the only party that can approach both the right wing and the left," he told Channel 2 TV. But he acknowledged the results would make it difficult for anyone to govern.
Israel's Palestinian peace partners in the West Bank said the next Israeli government would have to stop building in the West Bank before talks could resume.
"We now have clear conditions for whoever heads the Israeli government," said Rafiq Husseini, a senior aide to Palestinian President Mahmoud Abbas. "The conditions for negotiations to resume begin with the immediate halt of settlement activities."
Peace talks have not included the Gaza Strip's Hamas rulers, who do not recognize Israel's right to exist and were the target of the devastating Israeli military offensive.
In Gaza, Hamas spokesman Fawzi Barhoum said the election results don't make a difference in the lives of Palestinians because Israel "is still working to eliminate the Palestinian existence.
"Anyone who thinks that new faces might bring change is mistaken," Barhoum said, before the exit polls were released.