You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
The election result looked likely to yield a coalition government led by conservative New Democracy but leaves an emboldened SYRIZA bloc to rally angry opposition in the streets to the punishing terms of the bailout.
Official results released by the interior ministry, with 97 percent of ballots counted, showed New Democracy taking 29.7 percent of the vote, with SYRIZA on 26.9. The PASOK Socialists were set to take 12.3 percent of the vote.
Because of a 50-seat bonus given to the party which comes first, that would give New Democracy and PASOK 162 seats in the 300-seat parliament, in an alliance broadly committed to the 130 billion euros ($164 billion) bailout.
Germany signalled there may be some leeway on the timeframe for cuts demanded in return for the aid.
The result buys time for the euro zone, which was braced for a SYRIZA victory and the prospect of having to cut debt-ridden Greece loose, potentially unleashing shocks that could break up the single currency.
But it exposed a deeply divided society, seething over the wage, job and pension cuts imposed as the price of two EU/IMF bailouts since 2010 totalling 240 billion euros.
The savage austerity has helped condemn Greece to five years of record recession and plummeting living standards.
Any new government could find its tenure short-lived. New Democracy and PASOK are unlikely to have won much more than 40 percent of the vote between them.
"The Greek people voted today to stay on the European course and remain in the euro zone," New Democracy leader Antonis Samaras, 61, told jubilant supporters. "There will be no more adventures, Greece's place in Europe will not be put in doubt."
FIGHT GOES ON
SYRIZA leader Alexis Tsipras, a former communist and student protest leader, conceded defeat, but vowed to spearhead opposition to Greece's austerity drive.
"From Monday, we will continue the fight," said Tsipras, who has gone from fringe obscurity to worldwide recognition in a matter of weeks. "A new day for Greece has already dawned," he said.
His supporters chanted, "Today was only the start. We will fight to topple these policies."
Two PASOK party officials said the Socialists would support a New Democracy-led government, either by actually ruling with them or by voting with the government in parliament. PASOK said it wanted an administration to include SYRIZA, but the radicals ruled this out.
The White House said it hoped the election outcome would lead to the swift formation of a new government that would make "timely progress" on economic challenges.
"We believe that it is in all our interests for Greece to remain in the euro area while respecting its commitment to reform," Jay Carney, President Barack Obama's press secretary, said.
Leaders of the Group of 20 world economic powers were convening in Mexico for a meeting on Monday.
Samaras told Reuters he was relieved by the vote. "I am relieved for Greece and Europe. As soon as possible we will form a government," he said.
A spokesman for Angela Merkel said on Twitter that the German chancellor had called Samaras to congratulate him "on good result, hope for quick, stable government".
Under a scorching sun, voters appeared torn between deep anger over the terms of the bailout and the traditional ruling parties who adopted it, and fear that a SYRIZA victory could bring a return to the drachma and even more economic calamity.
Many Greeks blame the traditional elite under New Democracy and PASOK for presiding over years of corruption and waste which have left them with a ruined economy and one of the heaviest debt burdens in the world.
The edges of Greek society are starting to fray under the country's severest test since the overthrow of the military dictatorship in 1974. The ultra-right Golden Dawn party looked set to win 18 seats.
The streets of central Athens are scarred by repeated waves of protests, some hospitals are short of vital medicines and reports of suicides caused by the crisis have become routine.
"I voted for the bailout because these are the terms that will keep us in Europe," said 66-year-old English teacher Koula Louizopoulou after casting her ballot in Athens, hinting that she had chosen New Democracy.
"It's the first time I feel depressed after voting, knowing that I voted again for those who created the problem, but we don't have another choice."
ROOM FOR RENEGOTIATION?
Euro zone finance ministers said the bailout terms remained the best way to drag Athens out of the crisis.
"The Eurogroup acknowledges the considerable efforts already made by the Greek citizens and is convinced that continued fiscal and structural reforms are Greece's best guarantee to overcome the current economic and social challenges and for a more prosperous future of Greece in the euro area," they said in a statement.
Euro zone paymaster Germany said the result represented a commitment to the bailout.
"The German Federal Government would consider such a result a decision by Greek voters to force ahead with the implementation of far-reaching economic and fiscal reforms," German Finance Minister Wolfgang Schaeuble said in a statement.
Samaras says he wants to renegotiate the bailout terms to promote growth and has called for an extra two years to make the cuts demanded of his country.
But Greece's euro zone peers are prepared only to change the margins of the deal. Its lenders say a new government must accept the conditions of the bailout or funds will be cut off, driving Athens into bankruptcy.
"There can't be substantial changes to the agreements but I can imagine that we would talk about the time axes once again, given that in reality there was political standstill in Greece because of the elections, which the normal citizens shouldn't have to suffer from," German Foreign Minister Guido Westerwelle said on German TV station ARD.
The euro hit a one-month high against the U.S. dollar, rising to around $1.2747 in early Australasian Monday trade, from around $1.2655 late in New York on Friday.
"What stands out is how close SYRIZA came ... so we expect some robust opposition to the austerity measures," said Daragh Maher, currency strategist at HSBC in London. "Markets will be concerned about how narrow the margin of victory was for ND and any gains in the euro and other markets will be limited."