Albania's conservative prime minister has conceded election defeat to the rival Socialists, taking personal responsibility for the heavy loss and resigning as leader of his party.
Sali Berisha quit as leader of the centre-right Democratic party and conceded while addressing party supporters.
Socialist Edi Rama was ahead with 53% of votes counted, compared to just 36% for the Democrats. The 68-year-old Berisha has dominated post-communist politics in Albania and had been seeking a third straight term as prime minister in Sunday's general election.
"We have lost these elections. Believe me, the responsibility for this falls on one person - on me, Sali Berisha," he said, wiping sweat from his brow. "I stand in front of you to say that the election result is clear. Of course I accept it and the Democratic Party accepts it."
Albania, once one of the world's most reclusive countries during its communist years, became a Nato member in 2009 and has applied for European Union candidate status. But so far that has been denied over criticism it has not done enough to fight corruption and push through democratic reforms.
Berisha is a divisive figure, praised by supporters as the politician who stabilised post-Communist Albania, but branded by opponents as a populist who tolerated corruption.
Many voters are also frustrated as they try to weather the effects of recessions in nearby Greece and Italy, where many Albanian migrants work to provide remittances back to their impoverished country.
Berisha, a cardiologist, was Albania's first post-communist president from 1992 until 1997, but his reputation was tarnished by the collapse of a pyramid banking scheme that saw many Albanians lose their savings and triggered violence that required an international peacekeeping force to quell. He came back in 2005, insisting he could run the government with clean hands.
Rama, the winner, gained popularity as mayor of the capital Tirana for more than a decade. He campaigned on an ambitious pledge to earn Albania candidate status within a year to eventually join the EU.
"This victory is ... only the start. That change will not come overnight and easily. All together we should work and sacrifice to make it happen," the 48-year-old said, also addressing his party supporters.