He said the agreement came after he met with the ambassadors and representatives of both Israel and Lebanon in the Oval Office.
"The Meeting went very well! The United States is going to work with Lebanon in order to help it protect itself from Hezbollah. The Ceasefire between Israel and Lebanon will be extended by THREE WEEKS," he wrote.
"It was a Great Honor to be a participant at this very Historic Meeting!"
Fighting between Israel and the Iran-backed Hezbollah militia escalated again in the wake of the Iran war. The Lebanese government is not an active party to the war and is seeking de-escalation.
"The United States is going to work with Lebanon in order to help it protect itself from Hezbollah," Trump said in a social media post.
He added that he is looking forward to meeting in person with Israeli Prime Minister Benjamin Netanyahu and Lebanese President Joseph Aoun "in the near future."
The ceasefire, reached after talks between the two nations' ambassadors to Washington last week and set to expire on Sunday, has yielded a significant reduction in violence.
Attacks have continued in southern Lebanon, however, where Israeli troops have seized a self-declared buffer zone.
Iran-backed Hezbollah says it has "the right to resist" occupying forces. Vice President JD Vance, Secretary of State Marco Rubio, US Ambassador to Israel Mike Huckabee and US Ambassador to Lebanon Michel Issa also attended the meeting.
The Israeli military said on Thursday that it killed two armed individuals in southern Lebanon after identifying them approaching soldiers and posing what it described as an immediate threat.
It was not immediately clear whether the incident was related to strikes reported earlier in nearby areas by Lebanon's health ministry, which said an Israeli air strike had killed three people and artillery shelling wounded two others, including a child.
Wednesday was Lebanon's deadliest day since the ceasefire took effect on April 16.
Those killed by Israeli strikes included Lebanese journalist Amal Khalil, according to a senior Lebanese military official and her employer, Al-Akhbar newspaper.
Hezbollah politician Hassan Fadlallah said the group wanted the ceasefire to continue but "on the basis of full compliance by the Israeli enemy".
At a televised press conference, he reiterated Hezbollah's objections to the face-to-face talks and urged the government to cancel all forms of direct contact with Israel.
Hostilities between Hezbollah and Israel reignited on March 2, when the group opened fire in support of Iran in the regional war. The ceasefire in Lebanon emerged separately from Washington's efforts to resolve its conflict with Tehran, though Iran had called for Lebanon to be included in any broader truce.
Nearly 2500 people have been killed in Lebanon since Israel went on the offensive following Hezbollah's March 2 attack, according to Lebanese authorities.
Israel is occupying a belt of the south that extends five to 10km into Lebanon, saying it aims to shield northern Israel from attacks by Hezbollah, which has fired hundreds of rockets during the war.
with AP and DPA