BEIRUT (AP) — Lebanon and Syria have signed an agreement on border demarcation and to boost coordination between the two countries regarding security along their tense frontier, the Saudi Press Agency reported Friday.

The deal signed by the Lebanese and Syrian defense ministers in Saudi Arabia late Thursday came after clashes in border areas earlier this month left several people dead and dozens wounded on both sides.

The plan for border demarcation also comes after the ouster in early December of the 54-year Assad family rule in Syria, leading to tensions along the frontier where Lebanon's Hezbollah group was active on both side of the border during Syria's 14-year conflict. Hezbollah had been fighting in Syria alongside Assad during the conflict that has left half a million people dead.

The deal also comes after the 14-month Israel-Hezbollah war that weakened the Iran-backed group in Lebanon.

Lebanese Defense Minister Michel Menassa was scheduled to visit the Syrian capital, Damascus, on Wednesday but the visit was canceled. Menassa and his Syrian counterpart, Murhaf Abu Qasra, later flew to Jiddah in Saudi Arabia on Thursday, where they held talks that were attended by Saudi Defense Minister Khalid bin Salman and signed the deal.

The Saudi agency said the Lebanese and Syrian ministers signed an agreement in which both sides agreed on the “strategic importance to demarcate their border” and the formation of legal and specialized committees in different fields. It added that both countries agreed to “activate coordination mechanisms” to deal with any security challenges along the border.

It said Saudi Arabia backs security and stability in both countries and that boosts security in the region.

Over the past weeks, authorities on both sides of the nearly 400-kilometer (250-mile) -long border have been closing smuggling routes along the unmarked frontier.

Earlier this month, intense clashes broke out along the border after Syria’s interim government accused militants from Lebanon’s Hezbollah group of crossing into Syria, abducting three soldiers and killing them on Lebanese soil. The Lebanese government said the three killed were smugglers.

Hezbollah denied involvement, and some other reports pointed to local clans in the border region that are not directly affiliated with Hezbollah but have been involved in cross-border smuggling. Authorities in Beirut at the time said seven Lebanese citizens were killed and 52 were wounded.