At a European Union summit meeting on Friday, Mr. Macron confirmed that Mr. Hariri’s arrival was imminent. “He has the intention of going to his country in the days or weeks ahead,” Mr. Macron said.
He later said that Mr. Hariri would be “received with the honors due a prime minister,” notwithstanding his announcement of his resignation.
Mr. Macron also told journalists that France did not want to choose sides in the Middle East, adding that “the role of France is to talk to everyone.” However, he also urged Iran to pursue a “less aggressive regional strategy.”
As night fell in Paris on Friday, there was no sign of Mr. Hariri. At 1:10 a.m. in Saudi Arabia, Mr. Hariri wrote on Twitter that he was free to leave the country, and added that he was “on the way to the airport.” His tweet mentioned Sigmar Gabriel, the foreign minister of Germany, who had asked whether the Saudis were holding Mr. Hariri.
Mr. Hariri had arrived in Riyadh just as Saudi Arabia’s crown prince, Mohammed bin Salman, put many of the country’s most wealthy and powerful men, including some members of the royal family, under de facto arrest in what has been described as an anti-corruption sweep. His visit also came as the Saudis accused Iran-backed rebels in neighboring Yemen of firing a missile at Riyadh.
It was not clear if Mr. Hariri’s trip was related to these events.
In Lebanon, many questions remain, including whether and when Mr. Hariri will return; whether he will hand in his resignation or rescind it; and whether there will be a reorganization of the government.
“The crisis of the resignation and Hariri’s return is now finished, but a political crisis has just begun,” Lebanon’s parliament speaker, Nabih Berri, said on Friday after news emerged that Mr. Hariri would fly to Paris.
Regardless of his next moves, Mr. Hariri will remain beholden to Saudi Arabia. His personal and family finances are deeply entwined with the country, which has also backed his party’s extensive political patronage network and media outlets. But the Saudi gambit to get him to take a more confrontational approach against Iran and Hezbollah could end up backfiring.
Mr. Hariri could end up presiding over a caretaker government ahead of elections planned for next year. Analysts and diplomats said that Saudi Arabia was likely to gain little more than a renewed rhetorical commitment from all sides to Lebanese neutrality, especially now that the kingdom appears to have climbed down somewhat under international pressure.
What is clear is that Mr. Hariri was abruptly summoned to Riyadh, days after holding meetings with officials there that left him optimistic that Saudi Arabia was on board with his pragmatic approach.
One theory was that Saudi Arabia was angered when Mr. Hariri met in Beirut with Ali Akbar Velayati, an adviser to Iran’s supreme leader, hours before flying to Riyadh. Another was that plans were in the works for longer, after earlier meetings with the Saudi crown prince, Mohammad bin Salman, by Samir Geagea and Sami Gemayel, representing Christian parties that also wanted him to take a tougher line on Hezbollah, and by President Trump’s son-in-law, Jared Kushner, who has encouraged the prince’s hard line in the region.
Tension had been building during the year since Mr. Hariri formed a national unity government in a deal that brought Michel Aoun, a political ally of Hezbollah, to the presidency.
Hezbollah gained new power and weaponry while helping President Bashar al-Assad of Syria, another Iran ally, beat back insurgents. Mr. Aoun began signaling plans to normalize relations with the Syrian government, with members of his party even meeting with Syrian diplomats in New York during the annual General Assembly gatherings. That was too much for some of Mr. Hariri’s allies and supporters, and for Riyadh.
As Mr. Hariri’s sojourn in Riyadh dragged on, there were even concerns in Lebanon that Saudi Arabia had plans for further escalation, whether pulling Israel into a war, or fomenting internal violence in Lebanon, perhaps by instigating an attack by Palestinian or Syrian refugees that could provoke a crisis. International and Lebanese officials kept in close touch to make sure the security situation remained calm.
Meanwhile, Mr. Hariri reached out to Jordan with a request to go to Amman as a safe haven, a Western official said. The request was denied, the official said, because the Saudis pressured Jordan not to accept him.
With the goal of avoiding conflict, Mr. Macron, who had been in Abu Dhabi, the United Arab Emirates, for an opening of a branch of the Louvre, made an unexpected stop in Saudi Arabia and spoke to Crown Prince Mohammed bin Salman. He also extended an invitation to Mr. Hariri to visit.
“In the case of the Middle East, he has indicated prudently that he will stay in contact with all the protagonists, without confining himself to one camp,” said Hubert Vedrine, a former foreign minister of France. “He wants to stay in contact with the Saudis, the Qataris and the Emiratis, and he has reconfirmed that he will go to Iran.”