Lebanese soldiers approach the town of Arsal near the Syrian border, which was taken by militants last week. Attempts on Tuesday to negotiate a cease-fire with the militants were not promising. (AFP/Getty Images)

Lebanon struggled on Tuesday to contain tensions unleashed by the seizure of a remote border town by Sunni militants in the latest example of the unchecked expansion of the al-Qaeda offshoot that is battling to establish an Islamic state across the Middle East.

The capture this past weekend of the town of Arsal by fighters with the extremist Islamic State gave the group its first foothold in Lebanon, extending the reach of the militants westward at a time when they are also making gains on the eastern flank of their self-proclaimed state against Kurdish forces in Iraq.

The upsurge of violence also has presented a major challenge to the stability of fragile Lebanon, which has largely withstood the tensions triggered by the three-year-old war raging next door in Syria despite its own fraught history of sectarian conflict.

Arsal, long a haven for Syrian rebels and for refugees fleeing fighting on the other side of the border, was overrun by fighters with the al-Qaeda-inspired Islamic State after the detention Friday of a prominent Syrian rebel leader by the Lebanese authorities. Surging into the Sunni town, the militants captured at least 15 Lebanese army soldiers and an unknown number of police officers, prompting the army to launch an offensive to reclaim it.

At least 17 Lebanese soldiers have since been killed in the fighting, according to army officers. In addition, 35 people have been killed in Arsal in shelling by the Lebanese army, some of them in fires that erupted when shells struck a tented settlement.

Concerns are mounting about the welfare of the remaining refugees trapped by the fighting, who have been without food or medical supplies for days. Most of the town’s 35,000 Lebanese residents have fled, but the Lebanese army has not permitted the departure of the Syrian refugees, estimated by aid agencies to number 90,000.

It was unclear whether the capture of Arsal represented a calculated attempt by the Islamic State to expand its reach into Lebanon or came in retaliation for the detention of the rebel leader, Abu Ahmed al-Jumaa, who had recently declared his allegiance to the Islamic State.

Attempts on Tuesday to negotiate a cease-fire by a delegation of Lebanese Sunni clerics were not promising. Gunmen opened fire on the delegation as it approached the town, injuring three. The assailants then shot at a group of Syrians who went to rescue the injured clerics, killing one of them and injuring several more, according to Haitham Tomia, a member of the negotiating team dispatched by the Association of Muslim Scholars.

He said the rebels in the town appear to be split, between those who want to negotiate an end to the fighting and the extremists, whom the clerics were unable to contact. The rebels who are talking to the delegation want to release the captive soldiers, withdraw from the town and end the fighting in return for guarantees of safety for the refugees who will remain behind, Tomia said.

As a gesture of goodwill, those rebels, including members of the al-Qaeda-affiliated Jabhat al-Nusra, released three Lebanese policemen captured on the first day of fighting. But the clerics have had no contact with the captors of the Lebanese soldiers, who are apparently with the more extremist Islamic State, leaving it unclear whether they are prepared to negotiate an end to the standoff.

“The people who are requesting the release of Jumaa are not part of the negotiations,” he said, referring to the rebel leader. “There is more than one group, they are not under a single leadership . . . and it is an unclear situation.”

A tentative truce, declared late Tuesday to facilitate the evacuation of wounded civilians and the release of the captive soldiers, failed to take hold after more shooting erupted. A senior Lebanese army officer, speaking on the condition of anonymity because of the sensitivity of the subject, said the army would not accept a full cease-fire with the militants unless all the hostage soldiers are freed.

Arsal, tucked into mountainous terrain on the northern edge of Lebanon’s Bekaa Valley, has long served as an important hub for Syrian rebels seeking to unseat President Bashar al-Assad. Its Sunni residents had mostly welcomed the refugees, many of them families of the fighters who crisscross the border. The town, however, had not previously been regarded as a stronghold of the Islamic State, whose support has mostly been concentrated in northern and eastern Syria.

Arsal residents and Syrian refugees said they were surprised by the sudden appearance of the militants, who swept into the town from the rocky wilderness spanning the Syria- Lebanon border Saturday. One Lebanese resident of the town, who asked to remain anonymous because he fears for his safety, said that no more than 50 Islamic State fighters entered the town. But Jumaa, the man detained by the army, is a popular local leader and the militants quickly rallied support from young men among the refugees crowded into tented settlements around the town, he said.

Meanwhile, tensions ignited by the confrontation threatened to erupt elsewhere in the country. Gunmen opened fire on a bus carrying Lebanese soldiers in northern Lebanon, wounding at least seven.

Sunni Lebanese politicians with the mainstream Future Movement accused the Shiite Lebanese movement Hezbollah of aggravating extremism by sending fighters into Syria to help Assad’s government combat the rebellion against his rule. In a statement, the movement called on Hezbollah to withdraw from Syria.

Hezbollah issued a statement denying allegations that its members were involved in the fighting.

Ahmed Ramadan contributed to this report.