PARIS (Reuters) - President Emmanuel Macron may have seen off the threat of France's far right, but he now faces a frustrating final three years in office after gambling away much of his political power in an election that has left France with a chaotic hung parliament.

Rolling the dice after Marine Le Pen's National Rally (RN) humbled his own party in June's presidential election, Macron challenged voters to decide again where power should lie.

Le Pen and her young protege Jordan Bardella were confident victory would be theirs. They were wrong.

A surge by the left-wing New Popular Front alliance, aided by tactical anti-RN voting, thwarted Le Pen. Even Macron's own centrist camp bettered the far-right vote.

Macron, 46, has a history of winning audacious bets, not least his first presidential run in 2017 when he had never held elected office. While he may have neutered the far right for now, Sunday's vote will shift political power from the Elysee Palace to a potentially disorderly parliament.

His Prime Minister, Gabriel Attal, gave his own blunt assessment, seeking to distance himself from Macron's electoral gamble on which he had not been consulted.

"From tomorrow, the centre of gravity of power will be ... more than ever in the hands of the parliament," Attal said as he announced his plan to resign from his post on Monday morning.

Macron rejected his offer, asking him to stay on for now to help to ensure stability.

OUT OF TOUCH

Macron said he wanted the election to provide clarity, but it has had the opposite effect, plunging France into the uncharted waters of coalition government and weakening his authority as president.

Macron's office did not return a request for comment.

The president's snap election call stunned close allies and opponents alike. Some from Macron's own camp have denounced it as a reckless move though others close to him argue it was not an entirely illogical decision, according to half a dozen sources in government or in his party speaking to Reuters on condition of anonymity.

The government expected to face no-confidence motions from opponents later in the year, and Macron hoped to catch them offguard with a quickfire ballot on his own terms.

Macron's move was indicative of how out of touch he had become with an electorate that was increasingly disenchanted with him, sources who know him well said.

"He dissolved parliament because he thought he could win," said one former advisor who worked with Macron at the Elysee, speaking anonymously to talk frankly about the president.

"What really astonishes me is how badly he misjudged the mood of the country," added the former aide, who noted "how quickly you can lose touch with reality" from inside the gilded cage of the President's palace.

WEAKENED HAND

France's fragmented parliament is likely to weaken its role in the European Union and further afield, and make it hard for anyone to push through a domestic agenda.

Leaders of the leftist alliance launched talks on what should happen next, with options including a minority government or a complex broader coalition.

Allies of Macron, who has not spoken publicly since Sunday's results, sought to distance themselves from an unpopular president and his election call. Macron's former prime minister Edouard Philippe said the vote had resulted in great uncertainty.

"I regret it but I am not surprised," Philippe said.

Others have put the blame on the small coterie of aides surrounding Macron. Ahead of the election, a visibly angry Finance Minister Bruno Le Maire hit out at the "lice crawling through the palace cracks" in a TV interview.

Macron's history of placing winning bets had given him an indestructible sense of his own destiny, most sources agree.

Theatre producer Jean-Marc Dumontet, a close friend of the Macrons, said the president's commitment to his decisions "makes you deaf to everything people around you tell you."

GROWING UNPOPULARITY

Elected in 2017 on a promise to rejuvenate French politics, Macron's popularity nosedived after he began to govern in a so-called "Jupiterian" fashion. He loosened labour rules by decree, cut housing allowances and raised fuel taxes while defiantly defending his security guard who beat up protesters.

His perceived arrogance soon created deep resentment across the country, which erupted in 2018-2019 with the "yellow vest" crisis. What began as a revolt against rising fuel prices soon morphed into a seven-month challenge to Macron's authority.

After being re-elected in 2022 after Russia launched its war on Ukraine, Macron's raising of the pension age using executive constitutional powers to bypass parliament further damaged his reputation among working-class and middle-class voters.

Aides said Macron believed voters would overlook his unpopularity and instead focus on his economic record. Alexandre Holroyd, a former lawmaker in the National Assembly, said Britain's Brexit vote should have served as a warning against such thinking.

Yet Macron didn't just misjudge how low his stock had fallen among voters, three sources said. He underestimated the left's ability to put aside its differences on issues like Gaza and antisemitism to form a united front against the far right.

The election revitalised the left, with France's next prime minister likely to come from its ranks. Fresh faces including moderate Raphael Glucksmann, Green leader Marine Tondelier and leftist Francois Ruffin have all emerged to challenge hardliner Jean-Luc Melenchon as the bloc's potential leader.

There is still a chance that Macron could turn political gridlock to his own advantage.

A chaotic "cohabitation" period could allow him to stay above the fray, leaving the door open for one of his centrist disciples in 2027, some political experts said.

"Two of the three previous cohabitations worked to the advantage of the president," said Sudhir Hazareesingh, a French politics expert at Oxford University, citing Francois Mitterrand and Jacques Chirac, who both recovered enough popularity to win a second mandate after a period of power sharing.

"But Macron is not experienced as these two men, and he is actually not a very astute political tactician," he said.

(Writing and reporting by Michel Rose; additional reporting by Gabriel Stargardter; Editing by Keith Weir)

By Michel Rose