Mr. Hariri announced on Nov. 4 from Riyadh, the Saudi capital, that he was stepping down as Lebanon’s prime minister, but officials in Lebanon have said that his departure would not take effect until he delivered his resignation in person in Beirut.

Mr. Hariri’s unexpected trip and resignation unsettled the Middle East, setting off a political crisis in Lebanon and even raising fears of war. Saudi Arabia was widely seen as pressuring Mr. Hariri to resign as part of its escalating regional feud with Iran and its effort to isolate Hezbollah, the Lebanese Shiite militia and political party that is part of Mr. Hariri’s coalition government.

Mr. Hariri said he feared for his safety in Lebanon.

With European diplomats scrambling to defuse the crisis, France seized the role of mediator. Mr. Macron made a surprise visit to Riyadh on Nov. 9. A week later, the French foreign minister, Jean-Yves Le Drian, met Mr. Hariri in the Saudi capital.

Mr. Macron’s deputy adviser on diplomacy also traveled from Paris to Lebanon during the crisis, while Mr. Macron was having “direct and frequent” contacts with leaders in the region, including President Abdel Fattah el-Sisi of Egypt and Prime Minister Benjamin Netanyahu of Israel, according to officials in the French president’s office.

France has strong ties to Lebanon, where it was a former colonial ruler, and to the Hariri family.

“It’s an occasion for France to show that it can be an intermediary and have a role in the crises of the Middle East,” Rima Tarabay, an adviser on European affairs for Mr. Hariri, said in a phone interview.

But Ms. Tarabay added that the crisis went beyond Mr. Hariri’s announced resignation, which has plunged the political situation of Lebanon in uncertainty.

“We are facing a very complex situation, not specifically tied to Saad’s personal issue, but regarding what is going to happen next,” Ms. Tarabay said, raising concerns about the potential “resurgence of violence in the region, and a war between Saudi Arabia and Iran.”