France has signed an agreement to sell and deliver $3 billion worth of military equipment to Beirut — paid for by Saudi Arabia — to help the Lebanese army fight jihadists encroaching on its border with Syria, officials announced Monday.

French foreign affairs minister Laurent Fabius welcomed the agreement, which he said "reflects the exceptional quality of French-Saudi relations." But the complex arms-sharing ménage à trois involves more than just the three actors, with Iran and Syria also factoring into the equation.

The deal, which has been in the pipeline since 2013, will provide much needed modern weaponry to Lebanon, which is currently fighting Islamic State militants in the Beqaa Valley, a mountainous region 19 miles east of Beirut on the Syrian border.

Beirut has been increasingly pulled into neighboring Syria's fight against the Islamic State, which began its bloodied land grabs across large swathes of Syria and Iraq this summer. Lebanon has also suffered several terrorist attacks by the militant group in recent months.

Lebanon is a multi-denominational state, comprised mostly of Christians and Muslims from both the Sunni and Shia sects. The country, which is still rebuilding itself after a fifteen-year civil war, is once again in the midst of its own dire political crisis, after deputies failed to elect a head of state to succeed outgoing president Michel Suleiman, who left office on May 25. The post has since remained vacant.

In early August, close to 3,000 jihadists stormed military checkpoints in the region around the Lebanese northwestern border town of Arsal. The rebels took control of the town for close to a week, before being pushed back by the Lebanese army. The Syrian town of Homs, which has been torn apart by fighting between the government army and rebels, is scarcely 40 miles from the Lebanese border.

While Lebanon's army is stepping up efforts to prevent Islamic State rebels from crossing into the country, it is also fending off the threat of the al Nusra Front — al Qaeda's Syrian arm. Since the August attacks, al-Nusra have taken around 30 Lebanese soldiers hostage in Syria, two of which have already been beheaded.

Following the Battle of Arsal, Syrian president Bashar al-Assad's foreign affairs minister pledged to support Lebanon, saying the Lebanese army required "help and assistance" to fight "takfiri terrorists" — another term for Islamic State extremists.

Syria's strategic ally and Shia regional heavyweight, Iran, also then got in on the action. According to Lebanese daily L'Orient Le Jour, Iran announced on October 30 that it would provide Lebanon with military equipment in order to, "help its troops fight the heroic war they are leading against terrorism." Iran also backs Hezbollah, the Shia Islamist group and political party based in Lebanon.

But not to be outdone, Saudi Arabia — which is ruled by a Sunni regime and is hostile to Shia Iran — hastened its own arms deal with Lebanon following the Iranian government's announcement, according to French daily La Tribune, leading to Monday's deal sealer, with France acting as weapons supplier.

So what exactly does $3 billion worth of equipment look like? According to La Tribune, which claims it got its hands on the list of weapons France will deliver to Lebanon, the arsenal will include armored personnel carriers equipped with gun turrets, light armored vehicles equipped with Mistral surface-to-air missile systems, Gazelle helicopters and transport helicopters, and three patrol ships furnished with Simbad missiles.

Former French air force Brig. Gen. Jean-Vincent Brisset told VICE News that the equipment sold by France was actually designed 30 years ago, but is being upgraded before being delivered to the Lebanese. While the equipment may not be state-of-the-art, it will still fill a great void in Lebanon's arsenal, he said.

"The Lebanese army is renown for not taking very good care of its equipment," Brisset added. "It still has a lot of American equipment that is starting to get old. The light armored vehicles, the Nexter gun turret, and the Gazelle helicopters will perfectly fulfill the needs of a small army that is fighting close to home."

Brisset said that the French army used the easy-to-fly Gazelle helicopters in Mali to fire rockets at Islamic militant pick-up trucks. The Nexter gun turret — a lightweight canon, which can fire missiles up to 1.2 miles — is also particularly adapted to guerrilla warfare, he said.

A few of the items on Lebanon's shopping list, however, are a little puzzling. Mistral and Simbad missile systems are anti-aircraft weapons, and so far, the Islamic state has not demonstrated a viable aerial threat, according to Brisset.

"Right now, the Islamic State does not have an air force," he said, "but Libyan jihadists could very well refurbish a few plans and give them to the Islamic State."

"They might soon have access to drones or to makeshift ground attack aircraft," added Brisset, "which could cause some real damage."

_Follow Virgile dall'Armellina on Twitter: _@armellina