Thousands of rightist supporters flooded into central Paris to celebrate the victory, but there were also skirmishes between leftist sympathizers and police in at least one city square and reports of sporadic violence in two suburbs near the capital.
Addressing cheering party faithful, Sarkozy pledged to push through his reform program, promising to wage war on unemployment and give a boost to French morale.
"The French people have chosen change. I will usher in this change because it is the mandate I have received from the people and because France needs it, but I will do it with all the French," he said, looking to heal the divisions of the campaign.
Sarkozy supporters celebrate (Photo: AP)
With almost all ballots counted, Sarkozy had won 53.1 percent of the vote against 46.9 percent for Royal. Turnout was some 85 percent -- the highest since 1981.
His emphatic win extends the right's 12-year grip on power but also marks the end of an era. Jacques Chirac, 74, will now retire after two terms as president of France, a nuclear power with a permanent seat on the United Nations Security Council.
Sarkozy, the son of a Hungarian immigrant, presented himself as the "candidate of work", promising to loosen the 35-hour work week by offering tax breaks on overtime and to trim fat from the public service, cut taxes and wage war on unemployment.
Voters saw the uncompromising Sarkozy as a more competent leader than Royal, with a more convincing economic program.
Congratulations
European Union leaders congratulated Sarkozy, who promised to put France back into the driving seat of Europe after the country voted down the EU constitution in a 2005 referendum.
"Tonight France is back in Europe," he said.
President George W. Bush also telephoned to offer his congratulations and said he expected good relations with Sarkozy, who has made a priority of repairing the damage to French-U.S. relations caused by tension over the Iraq war.
Sarkozy said France would be Washington's friend.
Sarkozy will take power on May 16. He will then name a government and start campaigning for June's parliamentary election, where he will seek a majority to implement reforms.
"I hope Nicolas Sarkozy's government will include representatives of the centre and some men and women of the left," former Labor Minister Francois Fillon, widely expected to be the next prime minister, told TF1 television.
Disappointed Royal supporters (Photo: AP)
An opinion poll released on Sunday said Sarkozy's UMP party would win 34 percent of the vote in June against 29 percent for the Socialists, suggesting they should secure a majority.
The president is elected for five years, is commander-in-chief of the armed forces, nominates the prime minister and is responsible for foreign and defense policies.
Royal was hampered by a string of campaign gaffes that raised doubts about her competency. Her party was also split by ideological divisions and Socialist heavyweights said the left now needed to undergo deep reform.
Violence
The Socialists portrayed Sarkozy as a danger for France, saying he was authoritarian and likely to exacerbate tensions in the poor, multi-racial suburbs that ring many French cities and where the epicenter of three weeks of rioting in 2005.
Thousands of extra police were drafted in to patrol sensitive suburbs on Sunday and a Reuters correspondent saw two cars burning a tough neighborhood north of Paris. Police said four cars and a bus were torched in another neighborhood.
Youths also clashed with police in Paris's Bastille Square and security forces fired repeated rounds of tear gas to try to break up the crowds. Disturbances were also reported in the southern cities of Toulouse and Lyon.
By backing Sarkozy, voters showed they wanted a strong leader to resolve France's many problems, including high unemployment of at least 8.3 percent, falling living standards, job insecurity and declining industrial might.
He has promised a clean break with the policies of Chirac, once his political mentor, and says he will curb the powers of the unions and toughen sentencing for criminals.