Sarkozy's face flashed up on television screens after polling stations closed at 8pm (1800 GMT), signalling his victory and setting off jubilant scenes among supporters gathered in central Paris.
"It will be worrying times for France if Sarkozy wins the presidency"
Be Humble, UK
Send us your views
Across the city at Socialist headquarters there was gloom and sorrow after the party crashed to its third consecutive presidential election defeat. It now faces the prospect of tough internal reform to make itself more appealing to voters.
In a speech at the UMP headquarters, Sarkozy said: "To all those French who did not vote for me, I want to say, beyond political battles, beyond differences of opinion, for me there is only one France. I want to tell them that I will be president of all the French.
"I want to launch a call to our European partners, with whom our destiny is deeply linked, to tell them that I have been European all my life, that I believe deeply, that I believe sincerely, in European construction and that tonight France is back in Europe. I beseech our European partners to hear the voices of people who want to be protected.
"I want to tell them [United States] that France will always be by their side when they will need her. But I want to tell them as well that friendship is accepting that one's friends can act differently, and that a great nation like the United States has the duty to not obstruct the fight against global warming but on the contrary to head this struggle because what is at stake is the future of all humanity. France will make this struggle its first struggle."
Although opinion polls regularly suggested voters preferred Royal, who was seeking to become France's first woman head of state, they saw the uncompromising Sarkozy as a more competent leader with a more convincing economic programme.
Talking before her supporters, Royal said: "I hope the next president of the republic fulfills his role in the service of all French people...I will continue with you and near you...You can count on me to deepen the renovation of the left...that is the condition of our future victories."