François Hollande has become France’s first leftwing president in almost 20 years after beating Nicolas Sarkozy. Photograph: Christophe Ena/AP

François Hollande has won the presidency of France, turning the tide on a rightward and xenophobic lurch in European politics and vowing to transform Europe's handling of the economic crisis by fighting back against German-led austerity measures.

The 57-year-old rural MP and self-styled Mr Normal, a moderate social democrat from the centre of the Socialist party, is France's first leftwing president for 17 years. Projections from early counts, released by French television, put him on 51.9% and Nicolas Sarkozy on 48.1%.

His victory is a boost to the left in a continent that has gradually swung right since the economic crisis broke four years ago.

From the town of Tulle in his rural heartland of Corrèze in southwest France, Hollande declared victory. "May 6 should be a great date for our country, a new start for Europe, a new hope for the world," he said. "I'm sure in a lot of European countries there is relief, hope that at last austerity is no longer inevitable."

He said his mission was to go to European leaders to demand measures for "growth, jobs and prosperity". Hollande's first move as president will be to push Germany to renegotiate Europe's budget discipline pact to include a clause on growth.

Hollande said France had voted for change, but he had a heavy responsibility to drag the country out of economic crisis. Vowing that France would no longer be fractured, divided or riven by discrimination, or those in the poor high-rise suburbs and abandoned rural areas cast aside, he said: "No child of the republic will be abandoned."

Sarkozy, defeated after one term in office, became the 11th European leader, including Gordon Brown, to be swept from power since the economic crisis in 2008. He conceded defeat at a gathering of his party activists at the Mutualité in central Paris, urging them from the stage to stop booing Hollande. "I carry all the responsibility for this defeat," he said. He had spoken to Hollande to congratulate him.

"From the bottom of my heart I want France to succeed with the challenges it faces. It is something much greater than us, France. This evening we must think exclusively of France." After 35 years in politics and 10 years at the top of government, he would now become a simple "Frenchman among the French".

The defeat of the most unpopular French president ever to run for re-election was not simply the result of the global financial crisis or eurozone debt turmoil. It was also down to the intense public dislike of the man seen as "President of the Rich" who had swept to victory in 2007 with a huge mandate for change. Most French people felt he had failed to deliver his promises, and he was criticised for his ostentatious display of wealth, favouring the rich and leaving behind him more than 2.8 million unemployed. Political analysts said anti-Sarkozyism had become a cultural phenomenon in France. The turnout was high, estimated at around 80%.

Hollande is the first Socialist president since Francois Mitterrand's re-election in 1988. Thousands of cheering supporters, including many intellectuals and arts figures, massed at Paris's Place de la Bastille, a flashpoint of the 1789 French revolution, where the left celebrated Mitterrand's first historic victory in 1981.

Taking the stage at Bastille after midnight, Hollande told the crowd his victory was a message to everyone in Europe that "change is coming", and that he brought hope for all the people in Europe, who regardless of their leaders, wanted "an end to austerity". He said he would "redress, repair and reunite" a fractured France that was "broken and burnt".

Hollande's win comes after a vitriolic campaign marked by support for the far-right Front National's Marine Le Pen, who came third in the first round with 17.9% and 6.4m votes. Sarkozy, who launched his campaign with a marked rightwing slant on the values of work, family and national identity, lurched even further to the right as he courted Le Pen's voters in the past two weeks, stressing the far-right topics of immigration, borders and fear of Islam. Socialists are hoping Hollande's victory is backed with a sweeping majority for the left in parliamentary elections next month.

Hollande, who has vowed to begin his reforms as soon as he takes office on 15 May, has accepted he will have "no state of grace" leading a country crippled by public debt and in economic crisis, with unemployment nudging a record 10%, a gaping trade deficit, stuttering growth and declining industry. Public debt is so high that interest repayments alone account for the highest state expenditure after education. The rating agency Standard and Poor's this year downgraded France's triple-A credit rating, citing in part that over-high state spending was straining public finances. Both Hollande and Sarkozy had promised to balance the books; France hasn't had a balanced budget for over 30 years. After Hollande's victory the euro fell to below $1.30 in early trading. Hollande's manifesto is based on scrapping Sarkozy's tax breaks for the rich and levying more from high earners to finance what he deems essential spending, including creating 60,000 posts in France's under-performing school system. He has pledged to keep the public deficit capped but for his delicate balancing act to work he needs a swift return to growth in France, despite economists warning of over-optimistic official growth forecasts that need to be trimmed.

Downing Street said David Cameron had called Hollande to congratulate him. Angela Merkel, the German chancellor, and Barack Obama also sent their congratulations. Ed Miliband, the Labour leader, said: "This new leadership is sorely needed as Europe seeks to escape from austerity. ... He has shown that the centre-left can offer hope and win elections with a vision of a better, more equal and just world."

In parliamentary elections in Greece, governing parties backing the EU-mandated austerity pact were on course for a major drubbing as hard-hit voters defected in droves, according to exit polls.

In a major upset that will not be welcomed by the crisis-plagued country's eurozone partners, the two forces that had agreed to enact unpopular belt-tightening in return for rescue funds appeared headed for a beating, with none being able to form a government.

After nearly 40 years of dominating Greek politics, the centre-right New Democracy and socialist Pasok saw support drop dramatically in favour of parties that had virulently opposed the tough austerity regime dictated by international creditors.