The head of Greece's conservative New Democracy party, Antonis Samaras, enters the President's office to take the mandate to form the new government in Athens on Wednesday June 20, 2012. Samaras was sworn in as prime minister Wednesday at the helm of a three-party coalition that will uphold the countrys international bailout commitments. The move ends a protracted political crisis that had cast grave doubt over the countrys future in Europes joint currency and threatened to plunge Europe deeper into a financial crisis with global repercussions. (AP Photo/Andreas Solaro,pool)

Greece's conservative New Democracy party leader Antonis Samaras was on Wednesday sworn in as prime minister of a three-party coalition, which will face the task of renegotiating tough bailout terms with foreign creditors.

“I am asking the Greek people for patriotism, trust and national unity and with the help of God we will ensure that the Greek people can emerge from the crisis,” Samaras told reporters as he left the presidential palace.

“I will do whatever it takes to take the country out of the crisis ... we will have to work hard to give our people tangible hope.”

Samaras, 61, was sworn in by President Karolos Papoulias, after coming first in an election on Sunday, the second election in six weeks.

German Chancellor Angela Merkel congratulated Samaras by phone and wished him “luck and success in the difficult task that lies ahead of him.” She also invited him to visit Berlin.

Samaras narrowly beat the anti-bailout SYRIZA party, under the leadership of Alexis Tsipras, who has rejected joining a broad coalition government.

After three days of negotiations, New Democracy agreed to form a coalition government with the socialist PASOK party, which came in third place, and the smaller Democratic Left. The new cabinet is expected to be announced on Wednesday evening.

“Greece has a government,” PASOK leader and former finance minister Evangelos Venizelos said.

He said that the country will be represented at the upcoming meeting of eurozone finance ministers in Luxembourg by outgoing Finance Minister Giorgos Zanias.

Zanias held talks with Samaras, Venizelos and Kouvelis ahead of the eurozone meeting next week. The talks were also attended by National Bank of Greece chairman Vasilis Rapanos who is tipped to succeed Zanias as finance minister.

Venizelos said the meeting “will be the first attempt for the revision of the bailout agreement and the creation of a framework that will allow us to have positive growth and to fight unemployment.”

The Athens Stock Exchange rose after the news, with the main index closing up 0.50 per cent.

Samaras' appointment ended weeks of uncertainty over the future of Greece in the euro.

The new prime minister and Venizelos want to soften the terms of unpopular austerity measures demanded by the European Union and International Monetary Fund in exchange for bailout loans.

But the new government has its work cut out for it as it must follow through on promises to implement cutbacks worth more than 11 billion euros, privatise state-owned companies, open closed professions to competition and cut some 150,000 civil service jobs.

A European official said on Tuesday that the terms would have to be changed, given Greece's worsening recession, which sent unemployment to a record 22 per cent.

On Wednesday, hundreds of unemployed people queued in a central Athens square for free vegetables handed out by farmers in cooperation with Athens' municipality. - Sapa-dpa