France faced a hung parliament and deep political uncertainty after the three main political groups of the left, center and right emerged from snap legislative elections on Sunday with large shares of the vote but nothing approaching an absolute majority.

Projections based on preliminary results upended widespread predictions of a clear victory for the National Rally, Marine Le Pen’s anti-immigrant party that dominated the first round of voting a week ago. Instead, the left-wing New Popular Front appeared to hold the lead, with between 172 and 208 seats, according to several polling institutes.

The centrist Renaissance party of President Emmanuel Macron, who cast the country into turmoil a month ago by calling the election, was in second place with between 150 and 174 seats, the projections indicated. Trailing them was the National Rally, which took between 113 and 152 seats.

The details of the outcome may still shift, but it is clear that, to a remarkable degree, a scramble by centrists and the left to form a “Republican front” to confront the National Rally in the second round of voting worked. Candidates across France dropped out of three-way races and called for unity against Ms. Le Pen’s party.

“The president now has the duty to call the New Popular Front to govern,” said Jean-Luc Mélenchon, the far-left leader who is the charismatic but polarizing voice of the left-wing alliance. “We are ready.”

But France looked near ungovernable, with the Paris Olympics about to open in less than three weeks. The left surged, the National Rally added dozens of seats to its presence in the National Assembly, and Mr. Macron’s party suffered a stinging defeat, with the 250 seats held by his party and its allies in the National Assembly cut by about a third.

The result was that in the sharply divided lower house of Parliament, where most legislative power resides, no governing coalition appeared immediately conceivable, with Mr. Macron’s centrists squeezed between far-right and far-left groups that detest each other and him.

Jordan Bardella, the protégé of Ms. Le Pen who led the National Rally to victory in European Parliament elections and the first round of legislative voting last month, hailed “the most important breakthrough in all the history” of the party. He called the deals that frustrated its push for an absolute majority “an alliance of the dishonorable” and said Mr. Macron had condemned France to “uncertainty and instability.”

Even with fewer seats than predicted, the National Rally has now assumed a place in French politics that erased a postwar political landscape built around the idea that the far right’s history of overt racism and antisemitism made it unworthy of positions of power.

Ms. Le Pen has disavowed that past. But even in its rebranded form, the party’s core message remains that immigrants dilute a glorified French national identity and that tighter borders and stricter regulations are needed to keep them out or prevent them from benefiting from the French social safety net.

France rejected that vision, but voted overwhelmingly for change. It did not want more of the same. It sent a stinging message to the pro-business elites gathered around Mr. Macron, who is term-limited and must leave office in 2027.

“France is more divided than ever,” said Alain Duhamel, a prominent political scientist and author. “We have learned it was a very bad idea for Mr. Macron to dissolve Parliament and call this election.”

At a time when a faltering President Biden is struggling to counter the nationalist America First message of former President Donald J. Trump, protracted French political limbo could add to an unstable international situation. Long close to Russia, Ms. Le Pen has tried to recast herself as a guarded supporter of Ukraine, but there is no question that Moscow will welcome the National Rally’s growing influence.

The New Popular Front campaigned on a platform that would raise France’s monthly minimum wage, lower the legal retirement age to 60 from 64, reintroduce a wealth tax and freeze the price of energy and gas. Instead of cutting immigration, as the National Rally vowed, the alliance said it would make the asylum process more generous and smooth.

The platform said the alliance was supportive of Ukraine’s fight for freedom against Russia, and called for President Vladimir V. Putin to “answer for his crimes before international justice.”

How exactly the alliance’s economic program would be financed at a time when France faces a ballooning budget deficit, and how a pro-immigration policy would be applied in a country where it is perhaps the most sensitive issue, was unclear.

The New Popular Front, which is sharply divided between moderate socialists and the far left, did very well among young people in the first round of voting, and in the projects heavily populated by North African immigrants around major cities, including Paris.

The ardently pro-Palestinian stance of Mr. Mélenchon proved popular in these areas, even as it caused outrage when he appeared to cross a line into antisemitism, accusing Yaël Braun-Pivet, the Jewish president of the National Assembly, of “camping out in Tel Aviv to encourage the massacre.” He said of a large demonstration last November against antisemitism that “the friends of unconditional support of the massacre have their rendezvous.”

Nothing had obliged Mr. Macron to call the snap election, but he was ready to gamble he could still be a unifying figure against the extremes. In fact, he had lost the allure to do so over seven years in office. He declared left and right to be obsolete labels when he came to power in 2017. They no longer are.

Still, Mr. Macron’s centrist alliance did better than expected at the last and he lived to fight another day.

Mr. Macron now appears to have two options, excluding resignation, which he has vowed he will not contemplate.

The first is to try to build a broad coalition that might stretch from the left to what remains of moderate Gaullist conservatives, some of whom broke a taboo during the campaign by aligning with the National Rally.

This possibility seems remote. Mr. Macron has made no secret of his intense dislike for Mr. Mélenchon; the feeling is reciprocated.

The second, less ambitious option would be for Mr. Macron to try to form some sort of caretaker government to handle current business.

Mr. Macron might, for example, ask former prime ministers from parties across a centrist bloc — his own, the Socialists, the center-right Republicans — to suggest a government of technocrats or prominent personalities who could deal with a restricted agenda over the next year.

Under the Constitution, at least a year must elapse before the next parliamentary election.

One area where Mr. Macron may still be able to exert considerable influence, more than if he had been forced into a “cohabitation” with Mr. Bardella as prime minister, is international and military affairs, the traditional preserve of the president in the Fifth Republic.

An ardent supporter of the 27-nation European Union, which the National Rally wants to weaken, he will no doubt pursue his push for a “Europe power” with more integrated armies, defense industries and technological research, but his clout may be lessened by domestic weakness.

Mr. Macron, once tempted by a rapprochement with President Vladimir V. Putin of Russia, has also become an outspoken supporter of Ukraine’s fight for its freedom. With the American presidential election just four months away, doubts have grown over the willingness of the West to continue arming and funding Ukraine.

Russia clearly believes France will wobble. “The people of France are seeking a sovereign foreign policy that serves their national interests & a break from the dictate of Washington & Brussels,” the Russian foreign ministry said in statement a few days ago. “French officials won’t be able to ignore these profound shifts in the attitudes of the vast majority of citizens.”

France, in short, faces great uncertainty, both internally and externally. It appears that a constitutional crisis cannot be ruled out over the coming months. Gabriel Attal, the outgoing centrist prime minister who offered his resignation Sunday, declared that “tonight no absolute majority can be controlled by the extremes thanks to our determination and values.”

He was claiming a small victory, but of course the center does not have any such majority either.

Unlike many other European countries, including Belgium, Italy and Germany, France has no tradition of monthslong negotiation to form convoluted coalition governments between parties of divergent views, or of making caretaker alliances. Indeed, Charles de Gaulle designed the Fifth Republic in 1958 to put an end to the parliamentary turmoil and short-lived governments of the Fourth Republic.

One theory offered for Mr. Macron’s mysterious decision to call the election was that, with the National Rally governing and Mr. Bardella as prime minister, the sheen would have come off the far right party before the presidential election in 2027.

It was another gamble based on the idea that it is easier to rail from the margins than to make difficult governmental decisions. Mr. Macron does not want to hand the keys to the Élysée Palace, the seat of the presidency, to Ms. Le Pen three years from now.

In this sense, the election result may confound Mr. Macron and benefit Ms. Le Pen. She has demonstrated her growing popularity without her party assuming the burdens of office. On the other hand an ingrained French resistance to the idea of power passing to the far right was once again illustrated.

world