Georgia’s Central Election Commission said that with about 25 percent of the vote counted, Mr. Ivanishvili’s coalition, Georgian Dream, had 53 percent and the governing United National Movement had 42. The result is a sobering verdict on Mr. Saakashvili and his ruling team, who took power in the peaceful Rose Revolution nine years ago.

In his years in office, Mr. Saakashvili has restyled Georgia as a bastion of resistance to Russian influence and a laboratory for free-market economic policy.

He faced no formidable challenges until the emergence last year of Mr. Ivanishvili, a reclusive philanthropist who has spent years spreading his Russian-earned billions around Georgia’s countryside. Mr. Ivanishvili has tapped into long-simmering grievances over poverty and the heavy-handed ruling style of Mr. Saakashvili and his team.

It was a remarkable upset. After the exit polls were released, cars flying Georgian Dream flags screamed down the central artery here, and thousands gathered in Freedom Square. Temur Butikashvili, 52, a filmmaker, said it was the first time Georgia had changed its leadership through an election.

“We have done what all our ancestors aspired to. We have calmly, quietly transferred power,” Mr. Butikashvili said.

Of Mr. Saakashvili, he said: “We had great hopes when he came in. He studied in America; we thought he had an American mentality. But he turned from a democrat into an autocrat. He turned into an authoritarian.”

With Monday’s election, many felt the country was headed for a reckoning. Georgia has a history of chaotic power struggles — the first and second post-Soviet presidents left office before the end of their terms to avoid deepening civil unrest — and Mr. Ivanishvili’s supporters have warned that they will take to the streets rather than accept vote counts that they consider fraudulent.

Both sides had grounds to declare victory, but big questions loom. Venomous attacks have marked the campaign, and it is hard to imagine the two leaders collaborating for the year that remains of Mr. Saakashvili’s presidency.

At a news conference, Mr. Ivanishvili said there would be no prosecution of government officials unless they had violated law and that the police and prosecutors would keep their jobs.

Referring to Mr. Saakashvili, he said: “This is a man who cannot accept a different opinion.” He added, “This man was working without any opposing ideas. But nowadays things have changed.”One of the major differences between Mr. Ivanishvili and Mr. Saakashvili is on Russia; Mr. Ivanishvili has criticized the president for his open hostility toward Russia and suggested that he would take a more conciliatory line and Russian markets would reopen to Georgian produce, wine and mineral water, providing an economic lift. Meanwhile, Mr. Saakashvili has accused his opponent of being a front for the Kremlin.

Mr. Ivanishvili at the news conference said that Georgia was still headed toward NATO membership, but that he hoped to improve relationships with Russia. “Nothing will disturb our strategy — our strategic direction is NATO,” he said. He added that there would be no contact with the Kremlin. “Georgia cannot be a big geopolitical player, as Saakashvili said. We should be a regional player.”

There was palpable tension on Monday in the village of Karaleti, where identical concrete houses hold hundreds of families displaced from their land by the 2008 war with Russia.

When activists from Mr. Ivanishvili’s party visited over the summer, they were hounded out of town by residents shouting and waving sticks. Dato Chulkhadze, 38, lounged with a group of brawny men in T-shirts opposite Karaleti’s polling station on Monday, recalling the episode with satisfaction.

“People started to shout, ‘You are Russian, you are Russian,’ and they had no answer — even a small child knows they are on Russia’s side,” Mr. Chulkhadze said. Asked about Mr. Ivanishvili’s changes, he said, “I pray to God nothing like this will happen. If it happens, the Russians will return.”

But several residents approached a reporter quietly to say that support for Mr. Ivanishvili was higher than it appeared, except people were afraid to say so publicly. One woman, who would not give her name, said she was voting for Mr. Ivanishvili because “we should not be afraid when we talk.