Socialist leader George Papandreou joins party celebrations
Greece's opposition Panhellenic Socialist Movement (Pasok) has won an emphatic general election victory.
Outgoing PM Costas Karamanlis has congratulated Pasok leader George Papandreou and resigned as leader of the conservative New Democracy party.
With 99% of votes counted, Pasok had nearly 44% of the vote, to 33.5% for New Democracy - its worst ever result.
Pasok needed 43% to win an absolute majority in parliament. It has been in opposition for more than five years.
With a projected 160 seats in the country's 300-member parliament, Mr Papandreou has said he will inject up to 3bn euros ($4.4bn: £2.7bn) into the economy in an effort to pull Greece out of a financial crisis.
"Nothing is going to be easy. It will take a lot of hard work," he said. "I will always be upfront with the Greek people, so we can solve the country's problems together.
US President Barack Obama was among the first international leaders to congratulate Mr Papandreou in a telephone call on Sunday night.
'Set free potential'
In his first speech after being elected, Mr Papandreou warned Greeks they faced tough times.
"We stand here united before the great responsibility which we undertake," he told cheering supporters in Athens.
He said Pasok had waged "a good fight to bring back hope and smiles on Greeks' faces... to change the country's course into one of law, justice, solidarity, green development and progress".
"I know very well the great potential of this country. Potential that is being drowned by corruption, favouritism, lawlessness and waste. Potential that we will set free.
"I promise that I will do whatever is possible so that all Greeks will believe again that we can succeed, when we are united."
The BBC's Malcolm Brabant in Athens says voters preferred Mr Papandreou's promised stimulus package to the programme of austerity proposed by Mr Karamanlis.
Earlier, a humbled Mr Karamanlis said: "I assume responsibility for the result and will launch procedures for the election of a new party leader."
The build-up to the election was lacklustre, correspondents say, with a recent poll suggesting nine out of 10 voters no longer trusted either party.
Corruption scandals
Mr Karamanlis called the snap general election in early September, half way through his four-year term.
Mr Karamanlis had warned of the need for austerity
He said he wanted a new mandate to tackle Greece's economic problems, but his opponents said he failed to fulfil promises to clean up public office and to modernise the country.
The government has also been hit by a series of corruption scandals.
On Friday a small bomb exploded near Mr Karamanlis's final campaign rally.
The blast, which caused no injuries and only minor damage, was claimed by a leftist group calling itself The Fire Conspiracy Cells the following day.
Forty seats are automatically awarded to the leading party and the remaining 260 are divided by proportional representation.
Bookmark with:
What are these?