PARIS—The centrist ranks of President Emmanuel Macron and Marine Le Pen’s far-right party both failed to notch victories in France’s regional elections Sunday as voters gravitated toward establishment candidates amid tensions over recent terrorist attacks and the place of Islam in society.

Conservative candidates campaigning on anti-immigration and law-and-order pledges won seven regional presidencies across France while the Socialist Party won the other five.

The failure to win a single region delivered a blow to the parties of Mr. Macron and Ms. Le Pen ahead of next year’s presidential elections. But analysts said the unusually high number of people who abstained from voting this year—an estimated 65% compared with 42% in the previous regional elections in 2015—made it hard to forecast voter sentiment about the presidential hopefuls.

An estimated 65% of French people abstained from voting this year.

An estimated 65% of French people abstained from voting this year.

Photo: Laurent Cipriani/Associated Press

“French people did not see this election as a general rehearsal for the presidential elections,” said Adélaïde Zulfikarpasic, director at research-and-consulting firm BVA Group.

France has been buffeted by a string of terrorist attacks in recent years, including the beheading of a middle-school teacher by a Chechen refugee in October. That attack stunned the nation, with Mr. Macron describing it as an assault on France’s Enlightenment values and cracking down on mosques across the country.

Sunday’s election provided an early window into how voters are responding to the violence and its fallout. It also signaled how France’s myriad political parties are jockeying for position and forging alliances ahead of the April 2022 presidential election.

Les Républicains candidate Renaud Muselier won an estimated 57.4% of the vote in Provence-Alpes-Côte d’Azur, defeating Thierry Mariani, Ms. Le Pen’s best hope of securing the party’s first region, who only garnered an estimated 42.6%. After losing the first round of voting to Mr. Mariani a week ago, Mr. Muselier surged to victory on Sunday after the socialist and green parties effectively threw their support behind him by dropping out of the race. Mr. Macron endorsed Mr. Muselier early on, withdrawing his own candidate from the race.

Such alliances, known as the front républicain, are designed to impede National Rally’s path to power. The tactic was key to Mr. Macron winning the presidency in 2017 as establishment parties rallied behind his candidacy to ensure Ms. Le Pen’s defeat.

Thierry Mariani, the National Rally candidate for president of Provence-Alpes-Côte d’Azur, at a polling station on Sunday.

Thierry Mariani, the National Rally candidate for president of Provence-Alpes-Côte d’Azur, at a polling station on Sunday.

Photo: eric gaillard/Reuters

Mr. Macron rose to power on a platform of “neither right, nor left.” He created a new party, Republic on the Move, and formed a government that poached heavily from the ranks of establishment parties that had governed France since the end of World War II.

The successful showing by traditional parties in this year’s regional elections is likely to embolden their presidential candidates in challenging Mr. Macron as the standard-bearer of establishment politics in the country.

Three conservative presidential hopefuls won a region’s presidency on Sunday. Xavier Bertrand, a former member of the conservative Les Républicains party, won an estimated 52.8% of the vote in the North of France, where Mr. Macron’s candidate failed to qualify for the runoff.

Laurent Wauquiez of Les Républicains won the Auvergne-Rhône-Alpes region in the southeast of France, while conservative Valérie Pécresse was re-elected president of the Paris region.

Write to Noemie Bisserbe at noemie.bisserbe@wsj.com