PARIS—French voters elected Socialist Party candidate François Hollande as president Sunday, choosing a national leader who has pledged to shift the burden of economic hardship onto the rich and to resolve the protracted euro sovereign-debt crisis by softening the current prescription of austerity.

With his victory over conservative incumbent Nicolas Sarkozy in the second and final round of voting, Mr. Hollande—France's first Socialist president in 17 years—won a mandate to challenge German Chancellor Angela Merkel, who has imposed spending cuts as the main remedy to repair the public finances of heavily indebted European countries.

Mr. Hollande's first steps will have big implications. Both recession and unemployment are spreading across the 17-country monetary union, fueling doubts among voters, politicians and economists about the wisdom of slashing public spending in a downturn, which Ms. Merkel and others say is necessary to restore confidence in euro-zone public finances.

The growing malaise was also reflected Sunday in Greece, where voters delivered a stinging rejection of the two incumbent parties, with many people casting ballots for smaller, far-left and far-right parties.

In Germany, Ms. Merkel's coalition of Christian Democrats and pro-business Free Democrats suffered defeat in a closely watched state election in the northern state of Schleswig-Holstein Sunday, suggesting Ms. Merkel's options for ruling beyond 2013 are narrowing.