Before Lebanon's government approved a US-brokered deal settling a decades-long maritime boundary dispute with Israel, the powerful Hezbollah had scrutinized the final draft line by line and given a crucial nod of acceptance.
Branded a terrorist group by Washington and a sworn enemy of Israel, the Iran-backed Hezbollah was certainly nowhere near the negotiating room during US shuttle diplomacy which clinched the landmark deal last week.
But behind the scenes, the heavily armed group was being briefed on the details and expressing its views even as it threatened military action were Lebanon's interests not secured, according to sources familiar with Hezbollah's thinking, a Lebanese official and a Western source familiar with the process.
An unprecedented compromise between the enemy states, the deal opens the way for offshore energy exploration and defuses one source of potential conflict between Israel and Hezbollah.
Observers say the deal was all the more significant for the pragmatism shown by Hezbollah, pointing to the shifting priorities of a group set up four decades ago by Iran's Revolutionary Guards to fight Israel.
"The Hezbollah leadership scrutinized the understanding line by line before agreeing to it," said one of the sources familiar with the group's thinking.
After spending much of the last decade deploying fighters and military expertise across the Middle East to help Iran's allies, notably President Bashar al-Assad of Syria, Hezbollah's focus is today squarely on Lebanon - a country in deep crisis.
More involved than ever in state affairs, Hezbollah has said offshore oil and gas are the only way for Lebanon to emerge from a devastating financial meltdown that has hit all Lebanese hard, including its large Shi'ite constituency.
Though Hezbollah says it does not fear war with Israel, the group has also said it does not seek one with a formidable foe which staged major invasions of Lebanon in 1978 and 1982.
Lebanon took years to rebuild from the last war in 2006 - much of the bill paid by Gulf Arabs who have since shunned Beirut because of Hezbollah's sway. And while Tehran's support remains strong, Western sanctions have squeezed the amount of cash Iran can send the group.
'Havoc' or pragmatism?
An offshore energy discovery - while not enough on its own to resolve Lebanon's deep economic problems - would be a major boon, providing badly needed hard currency and possibly one day easing crippling blackouts.
Two Hezbollah lawmakers told Reuters the group was open to the idea of a deal as a pathway to alleviate some of Lebanon’s economic woes.
"They had to deal with it pragmatically instead of ideologically," said Sami Atallah, executive director of the Lebanese Center for Policy Studies, describing Hezbollah's role as critical. "They knew they had the power to cause havoc if they wanted to – but it would have come at such a high cost."
US proposals were communicated to Hezbollah's leadership by senior Lebanese security official Abbas Ibrahim, who also met US envoy Amos Hochstein, according to the Lebanese official and the Western source familiar with the process.
At one point, Hezbollah conveyed its frustration at the slow pace of the talks to Hochstein via Ibrahim, the Western source said.
Asked about Hezbollah's role, the head of its media office Mohamed Afif said the state had carried out the negotiations and "we stood behind it". "Our concern was for Lebanon to secure its rights to its resources," he said.
Reuters could not immediately reach Ibrahim's office for comment. The US State Department did not respond to emailed questions on the account of Hochstein's contacts with Ibrahim.
A senior US administration official has said the negotiations were carried out with the sovereign leadership of Lebanon and did not include discussions with Hezbollah.
The urgency of Hochstein's mission increased in June when an Israeli gas rig arrived offshore to explore in the Karish field - waters claimed by Lebanon but which Israel said were in its exclusive economic zone.
On July 2, Hezbollah sent three unarmed drones flying over the Karish field. They were intercepted by the Israeli military.
Hezbollah claimed it as a show of force and its allies in Lebanon credited the group's military posturing with wringing concessions from Israel - a claim completely denied by Israel.
A US official told Reuters Hezbollah had nearly "killed the deal with their provocative rhetoric and actions threatening war". "No one party can - or should - claim victory."
Peace is still far off
Hezbollah gave the greenlight to controversial details.
These included a tacit nod to arrangements that will lead to Israel getting a slice of revenues from the Qana prospect - which Lebanon deemed to be entirely in its waters, but which Israel said was partly in its.
The diplomatic workaround requires France's TotalEnergies - set to carry out exploration on behalf of Lebanon - to make a separate deal with Israel by which it gets a portion of royalties, bypassing any Lebanese involvement, politician Gebran Bassil, who closely followed the talks, told Reuters.
A spokesperson from TotalEnergies said they had no comment.
French officials met Hezbollah representatives about the overall agreement, three French diplomatic sources said.
The French foreign ministry said France actively contributed to the agreement, "in particular by passing messages between the different parties, in conjunction with the American mediator."
While the stars may have aligned to bring about this deal, peace remains a distant prospect between states at odds over numerous issues, and with Hezbollah's influence deeply entrenched in Beirut.
But more than 16 years since the last war, the benefits brought from any gas production could help stave off another one. "Once the pipes are in the water, war becomes a long way away," said a source familiar with Hezbollah's thinking.