* Fighting marks most serious spillover into Lebanon
* Sunni clerics wounded trying to enter Arsal overnight
* At least 16 Lebanese soldiers killed in Arsal fighting
* Seven others wounded in Tripoli; eight-year-old shot dead
* About 40 security personnel believed held, three released (Recasts with release of soldiers)
By Mariam Karouny and Alexander Dziadosz
BEIRUT, Aug 5 (Reuters) - Islamists militants, who seized the Lebanese town of Arsal at the weekend, released three policemen on Tuesday as a "goodwill gesture" to allow Sunni Muslim clerics to broker a deal to end four days of fighting near the Syrian border.
At least 16 Lebanese soldiers and dozens of civilians and militants have been killed in the fighting in Arsal in the most serious spillover yet in three years of civil war in Syria.
The militants are still believed to be holding about 40 members of the security forces - both soldiers and policemen.
A security source said the three policemen - identified by the militants as Rami Jamal, Khaled Saleh and Tannious Murad - were taken to a nearby hospital. One militant described the move as a "goodwill gesture" to allow talks to proceed.
Sunni clerics from the Muslim Clerics Association left Arsal on Tuesday after meeting with the militants, who say they are willing to withdraw if the army agrees to return to man the checkpoints outside Arsal and not to enter the town itself.
Two soldiers were killed in fighting in Arsal overnight, security sources said, while militants wounded at least seven others in the coastal city of Tripoli. An eight-year-old girl was also shot dead in the port city overnight.
The clashes in Arsal began on Saturday after security forces arrested an Islamist commander popular with local rebels who frequently move across the porous border with Syria. Shortly after the arrest, gunmen attacked security forces in the area.
Lebanese security officials say the fighters include members of al Qaeda's Syria branch, the Nusra Front, and an al Qaeda splinter group, the Islamic State, which has seized swathes of land in Syria and Iraq.
Although Lebanon - a country of about 4 million, bordering Israel - has avoided the full-scale war afflicting Syria and Iraq, regional conflicts have rekindled decades-old tensions.
Tripoli has seen frequent clashes between local Sunni Muslims and members of the Shi'ite-derived Alawite minority, and on Monday night fighting broke out after news that several Sunni clerics had been wounded as they entered Arsal to try to broker a ceasefire between the army and the militants.
Men blocked several Tripoli roads on Tuesday, and most shops were closed and streets empty after militants opened fire on a bus carrying soldiers, wounding at least six.
Gunmen had also fired on several army positions throughout the port city overnight, the National News Agency said. A girl was killed when a bullet hit her in the head.
"REFUGEES ARE ON THE STREETS"
Syrian activists and medics in Arsal say fighting has badly damaged the camps that are home to many of the tens of thousands of Syrian refugees estimated to live in and around the town.
"The situation is bad. Families are blockaded inside the city. Refugees are on the streets. There is a severe shortage of bread. The medical situation is very bad," a Syrian witness told Reuters in a text message.
Fighting had started again in Arsal, a mainly Sunni town, around 7 a.m. (0400 GMT) as the army tried to retake a number of buildings seized by militants, the National News Agency said.
While Lebanon has officially tried to distance itself from Syria's conflict, its powerful Shi'ite movement Hezbollah has sent fighters to aid President Bashar al-Assad, an Alawite. Assad, like Hezbollah, is backed by Shi'ite power Iran.
The rebels fighting to overthrow Assad are overwhelmingly Sunni and have received support from regional Sunni powers including Saudi Arabia.
Rocket fire, suicide attacks and gun battles connected to Syria's war have plagued Lebanon and the conflict has worsened Lebanon's perennial political deadlock between officials divided largely along sectarian lines.
More than 170,000 people have been killed in Syria's war, which started in 2011 as a peaceful protest movement, then degenerated into civil war after a government crackdown.
Violence went on unabated in Syria, where air strikes at the weekend in Damascus killed at least 64 people, a monitoring group said. Fighting regularly claims more than 150 lives a day. (Additional reporting Tom Perry; Editing by Louise Ireland)
Our Standards: The Thomson Reuters Trust Principles.