Forecasts by four pollsters showed Sarkozy, 52, a hardline former interior minister, won around 53 percent of the vote in the second-round ballot and will succeed fellow conservative Jacques Chirac, who was president for 12 years.
Turnout was predicted at about 85%.
Sarkozy's face flashed up on television screens after polling stations closed at 2 p.m. New York time, signaling his victory and setting off jubilant scenes among supporters gathered in central Paris.
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.
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 program.
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.
He is expected to take office on May 16 or 17, and will be the first French president to be born after World War Two.
He will then name a new government and immediately launch into campaigning for June's parliamentary election, where he will seek a clear majority to implement his reform plans.
The president is elected for five years, is commander-in-chief of the armed forces, nominates the prime minister, has the right to dissolve the National Assembly and is responsible for foreign and defense policies.
Royal started the year as favorite, but a string of gaffes over foreign policy raised doubts over her competency. Deep ideological divisions in her own camp meant she could never enjoy unified support from the Socialists.
She served up a gutsy performance in a television debate with Sarkozy last week, but he appeared more precise and controlled, further strengthening his status as front-runner.
Sarkozy's own personality has been questioned. Critics say he is impulsive, authoritarian and likely to exacerbate tensions in the poor, multi-racial suburbs that ring many French cities.
The Socialists accused Sarkozy of fuelling 2005 suburb riots by promising to rid neighborhoods of what he said were the "scum" responsible for the troubles. Royal said on Friday a victory for her rival would fan "violence and brutality".
Thousands of extra police have been drafted in to patrol sensitive suburbs, especially those close to Paris.
By backing Sarkozy, voters showed they wanted a strong leader to resolve France's many problems, including high unemployment of at least 8.3%, 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.
On foreign policy, Sarkozy is more pro-American than Chirac, but has made clear he opposes the war in Iraq and will find it hard to ally himself too closely to Washington because of anti-U.S. sentiment at home.
He has said one of his first acts as president will be to visit Berlin and then Brussels to lay out plans for a mini treaty to replace the European Union constitution that French voters rejected in a 2005 referendum.
After months of grueling campaigning, he has also indicated he will take a rest next week before returning to Paris to work on his new government. Former Labour Minister Francois Fillon is widely expected to become prime minister.