PARIS. FRANCE -- French President Emmanuel Macron refused the resignation of the country鈥檚 prime minister, asking him on Monday to remain temporarily as the head of the government after chaotic election results left the government in limbo.

French voters split the legislature on the left, centre and far right, leaving no faction even close to the majority needed to form a government. The results from Sunday鈥檚 vote raised the risk of paralysis for the European Union鈥檚 second-largest economy.

Macron gambled that his decision to call snap elections would give France a 鈥渕oment of clarification,鈥 but the outcome showed the opposite, less than three weeks before the start of the Paris Olympics, when the country will be under an international spotlight.

France鈥檚 main share index opened with a dip, but quickly recovered, possibly because markets had feared an outright victory for the far right or the leftist coalition.

Prime Minister Gabriel Attal had said he would remain in office if needed but offered his resignation Monday morning. Macron, who named him just seven months ago, immediately asked him to stay on 鈥渢o ensure the stability of the country.鈥 Macron's top political allies joined the meeting with Attal at the presidential palace.

Attal on Sunday made clear that he disagreed with Macron鈥檚 decision to call the surprise elections. The results of two rounds of voting left no obvious path to form a government for either the leftist coalition that came in first, Macron鈥檚 centrist alliance, or the far right.

Newly elected and returning lawmakers were expected to gather at the National Assembly to begin negotiations in earnest.

Macron himself will leave later in the week for a NATO summit in Washington.

Political deadlock could have far-ranging implications for the war in Ukraine, global diplomacy and Europe鈥檚 economic stability. Still, at least one leader said the results were a relief.

鈥淚n Paris enthusiasm, in Moscow disappointment, in Kyiv relief. Enough to be happy in Warsaw,鈥 Prime Minister Donald Tusk, a former European Union Council head, wrote late Sunday on X.

According to official results released early Monday, all three main blocs fell far short of the 289 seats needed to control the 577-seat National Assembly, the more powerful of France鈥檚 two legislative chambers.

The results showed just over 180 seats for the New Popular Front leftist coalition, which placed first, ahead of Macron鈥檚 centrist alliance, with more than 160 seats. Marine Le Pen鈥檚 far-right National Rally and its allies were restricted to third place, although their more than 140 seats were still way ahead of the party鈥檚 previous best showing of 89 seats in 2022.

Macron has three years remaining on his presidential term.

In announcing his resignation, Attal made clearer than ever his disapproval of Macron's shock decision to call the election, saying 鈥淚 didn't choose this dissolution" of the outgoing National Assembly, where the president's centrist alliance used to be single biggest group, albeit without an absolute majority.

Rather than rallying behind Macron as he'd hoped, millions took the vote as an opportunity to vent anger about inflation, crime, immigration and other grievances 鈥 including his style of government.

The New Popular Front鈥檚 leaders immediately pushed Macron to give them the first chance to form a government and propose a prime minister. The faction pledges to roll back many of Macron鈥檚 headline reforms, embark on a costly program of public spending, and take a tougher line against Israel because of its war with Hamas. But it's not clear, even among the left, who could lead the government without alienating crucial allies.

鈥淲e need someone who offers consensus,鈥 said Olivier Faure, head of the Socialist Party, which joined the leftist coalition and was still sorting out how many seats it won on Monday.

Macron warns that the left鈥檚 economic program of many tens of billions of euros in public spending, partly financed by taxes on wealth and hikes for high earners, could be ruinous for France, already criticized by EU watchdogs for its debt.

A hung parliament is unknown territory for modern France.

Despite the uncertainty, supporters on the left cheered in Republique plaza in eastern Paris when the first results came in, with people spontaneously hugging strangers and several minutes of nonstop applause.

Marielle Castry, a medical secretary, was on the Metro in Paris when projected results were first announced.

鈥淓verybody had their smartphones and were waiting for the results and then everybody was overjoyed," said the 55-year-old. 鈥淚 had been stressed out since June 9 and the European elections. 鈥 And now, I feel good. Relieved.鈥

The political agreement between the left and centre to block the National Rally was largely successful. Many voters decided that keeping the far right from power was more important to them than anything else, backing its opponents in the runoff, even if they weren鈥檛 from the political camp they usually support.

鈥淒isappointed, disappointed,鈥 said far-right supporter Luc Doumont, 66. 鈥淲ell, happy to see our progression, because for the past few years we鈥檝e been doing better.鈥

National Rally leader Le Pen, who was expected to make a fourth run for the French presidency in 2027, said the elections laid the groundwork for 鈥渢he victory of tomorrow.鈥

Racism and antisemitism marred the electoral campaign, along with Russian disinformation campaigns, and more than 50 candidates reported being physically attacked 鈥 highly unusual for France.

Unlike other countries in Europe that are more accustomed to coalition governments, France doesn鈥檛 have a tradition of lawmakers from rival political camps coming together to form a majority. France is also more centralized than many other European countries, with many more decisions made in Paris.

Associated Press journalists Helena Alves, Diane Jeantet, Jade Le Deley, and Alex Turnbull in Paris and Barbara Surk in Nice, France, contributed to this report.