Lebanese troops took control of a Palestinian refugee camp where they had been battling militants for more than three months, killing at least 31 fighters who tried to flee, security sources said.
Twenty-three more fighters from the Fatah al-Islam group were captured, 12 of them wounded militants detained after the army took over the Nahr al-Bared camp in north Lebanon, a security source said.
"The battle is over. The Lebanese army has seized the last positions of Fatah al-Islam in the camp," a senior security source told Reuters.
"Most of the terrorists were killed today. The others have been captured. A few might have escaped but the army is hunting them down," the source added.
The fate of Shaker al-Abssi, the Palestinian leader of the group which says it shares al Qaeda's ideology but has no organisational ties to the network, was unclear.
The fighting has been Lebanon's worst internal violence since the 1975-1990 civil war, killing more than 300 people.
Five soldiers were also killed on Sunday, raising the army death toll to 157. At least 131 militants and 42 civilians have been killed.
The army had initially estimated that only 35 active fighters remained in the camp before Sunday.
An army statement said the militants had tried to escape from the camp in the early hours of the morning.
They "attacked army positions in a desperate attempt to flee", the statement said, urging citizens to contact the army if they encountered suspect individuals.
At least three gunmen from outside the camp had also attacked an army position in order to help the fighters escape, security sources said.
Security forces patrolled the area, searching orchards and fields, while helicopters hovered overhead in a hunt for any militants who had managed to escape from the camp on the Mediterranean coast. Naval boats patrolled the sea.
Soldiers fired celebratory gunfire from inside the camp and locals threw rice at the troops to applaud their efforts.
Most of the camp's 40,000 residents fled to a nearby Palestinian refugee camp in the early days of the fighting, which erupted on May 20 when the army says Fatah al-Islam attacked its positions near the camp and the northern city of Tripoli.
Fatah al-Islam split from a Syrian-backed Palestinian faction last year. The hardline Sunni Islamist group includes Lebanese, Saudi and Syrian fighters.
The militants have put up fierce resistance, managing to inflict casualties on the army despite aerial and artillery bombardment. Their wives and children were evacuated from the camp on August 24.