Francois Hollande, a moderate Socialist with an easy smile, was elected president of France on Sunday, narrowly defeating the incumbent, Nicolas Sarkozy, a conservative whose five-year term was undermined by Europe’s economic crisis and his own combative personality.

The Socialist triumph, in a two-man runoff vote, was put at about 52 percent to 48 percent by a number of exit polls. The result marked a clear although not overwhelming margin by the standards of recent French presidential elections.

Sarkozy telephoned Hollande to concede defeat and, in an address to his followers, called on them to accept it in a dignified manner.

“Francois Hollande is president of France,” he said. “He should be respected. I want to wish him good luck amid the challenges.”

The outcome turned Sarkozy into the latest political leader to fall victim to the European economic implosion of the past four years. Widely predicted, his loss put him in the tracks of politicians in Spain, Greece, Italy, Portugal and Britain who have been voted out of power at least in part because they were identified with hard times for Western Europe’s traditionally comfortable economies.

Hollande’s triumph in turn was tempered by the still-fragile economic situation in France, which hems in the victor no matter what his ideology with a need to increase taxes and reduce government expenditures to lower a crushing $2 trillion government debt. In any case, Hollande’s free-market, social-democracy version of socialism carried no pledges of radical change — unlike the nationalizations that followed his party’s last presidential victory, when Francois Mitterrand rose to power in 1981.

In a victory address, however, Hollande emphasized that he intends to insist with fellow European leaders that more effort be placed on economic stimulus measures alongside the austerity that has plunged much of Europe into recession. He promised “a new departure for Europe” in which addressing growth and unemployment would get equal priority with balancing budgets.

With that in mind, aides said, his first telephone call would go to Chancellor Angela Merkel of Germany and his first trip as president would be to Berlin.

Aside from the emphasis on austerity in the European Union, Hollande’s major foreign-policy difference with the pro-American Sarkozy was over the timetable for withdrawal of about 3,600 French military personnel from the highly unpopular Afghanistan war, including about 2,400 combat troops.

Sarkozy had pledged to have combat units out by the end of 2013, slightly ahead of the schedule set by NATO and the United States. But Hollande promised voters he would bring home the combat troops by the end of this year, leaving in place only military instructors and logistics specialists to ship back equipment.

From longtime aide to leader

Hollande’s victory marked an astounding rise to the summit for a man who made his reputation as an amenable aide to the powerful and who has never held high national office. Good-humored and overweight, he was given little chance when he declared his candidacy well over a year ago, even by some fellow Socialists, who derided him as “the marshmallow” because of his conciliatory approach to problem-solving.

At the time, Dominique Strauss-Kahn, then the International Monetary Fund chief, was considered all but certain to become the Socialist Party candidate. His career was shattered, however, when he was charged last May with sexual assault in a New York hotel room, a charge that was later dismissed. In March, he was charged in Lille with procuring prostitutes.

Hollande, 57, lost weight, donned stylish glasses and set out to change his image first with the Socialist Party faithful and then with the broader French public. More important, perhaps, he adroitly surfed a wave of discontent against Sarkozy’s hard-charging presidency, building an early lead in opinion polls.

The edge narrowed as the campaign went on but never went away, despite Sarkozy’s last-minute appeals to anti-immigration sentiment in an attempt to draw support from far-right voters who had cast their ballots in the first round April 22 for Marine Le Pen of the National Front.

Sarkozy was generally given high marks for statesmanship in dealing with the economic crisis in the European Union and with other foreign-policy crises, including his leadership in bringing down Moammar Gaddafi in Libya. But voter dissatisfaction swelled nevertheless, in part from an impression that working-class French people were not getting enough attention as Sarkozy dealt with the crisis, and in part from a widely shared feeling that the president was not a pleasant man.

Sarkozy, also 57, campaigned with the passion and energy that have been his trademark over a long political career, promising his followers in the Union for a Popular Movement a swell of support unregistered by the polls from what he called “the little people of France, those without rank.” But sinking purchasing power, unemployment hovering at nearly 10 percent and pessimism over the future combined with his often aggressive attitude to turn the tide for Hollande.

The Socialist candidate, although making clear that hard times lie ahead, promised to apportion out austerity with a more even hand. In one telling argument, he charged Sarkozy with protecting the rich by limiting upper-tier tax rates and said, if elected, he would impose a 75 percent rate on all earnings above $1.3 million a year to finance more help for the poor.

Career in left-wing activism

Hollande, who formerly headed the Socialist Party, has never been a government minister, although he has served for years in the National Assembly, the lower house of Parliament. For most of his career, he has represented the largely rural Correze region in central France, where flattering cows and sniffing cheeses are an important part of getting elected.

Hollande was born in the Normandy city of Rouen, the son of a well-to-do doctor who dabbled unsuccessfully in far-right politics. When Hollande was a boy, the family moved to the posh Paris suburb of Neuilly, where he attended secondary school with other children of well-off families. Although the two did not grow up together, Neuilly was also the suburb where Sarkozy spent his youth, became mayor as a young man and launched his political career.

A brilliant student, Hollande graduated from the Political Studies Institute and the National Administration School, select academies where France grooms its elite. From the beginning, he was an activist in left-wing political causes.

His activism got him noticed by Socialist Party figures and when Mitterrand moved into the presidential palace after his 1981 victory, Hollande was taken on as a junior assistant for economic matters. From there, his political career took him from one ministerial cabinet to another, including that of Prime Minister Lionel Jospin, until he became president of the Socialist Party in 1997.

The young Hollande struck up a relationship at the National Administration School with Segolene Royal, with whom he had four children but never married. The couple separated around the time Royal ran for president in 2007 and Hollande began a new relationship with Valerie Trierweiler, 47, a journalist. They have lived together since then but have not married and have no children.

Trierweiler has said she undoubtedly would have to abandon journalism if Hollande was elected president. But, asked about the protocol problems their unmarried status could raise, particularly during trips abroad, Hollande has said that is a question for him and Trierweiler — without providing an answer.