The last militant stronghold of a Palestinian refugee camp devastated by more than three months of fighting between Islamic fighters and Lebanese soldiers fell to the army on Sunday, security officials said.

Hours after the army killed 32 militants and captured at least 15 others as they tried to break out of the Nahr el-Bared camp, only occasional gunfire could be heard inside.

The officials, speaking on condition of anonymity, said the last stronghold of Fatah Islam militants fell later in the day to the army, which captured five wounded militants in their hideout.

Celebratory gunfire erupted in nearby villages as soon as the news spread. Dozens of residents took to the streets of Mohammara, waving Lebanese flags and honking their horns as troop convoys poured into the area with soldiers flashing victory signs.

The army, which said it lost five soldiers in the recent violence, was not ready to formally declare an end to fighting in the camp, large parts of which have been destroyed by army bombardments in the monthslong siege. The military said three soldiers were killed in Sunday's fighting and two on Saturday, raising to 158 the total number of troops killed in the conflict.

A military statement early Sunday said troops were attacking the remaining militant strongholds inside Nahr el-Bared and "chasing the fugitives outside the camp" who had staged "a desperate attempt to flee." It called on Lebanese citizens to inform the nearest army patrol of any suspected militants in their area, but gave no specifics on casualties except saying "a large number" had been killed or captured.

The gunbattles began with the breakout near dawn and tapered off by the afternoon, with troops searching for Fatah Islam fighters in buildings, fields and roads around Nahr el-Bared camp, residents reported.

Before Sunday's battle, Lebanese officials had said up to 70 Fatah Islam fighters remained in the camp. When the fighting erupted more than three months ago, the number was estimated at 360.

According to security officials and television reports, a group of militants sneaked through an underground tunnel to an area of the camp under army control and fought with troops. At the same time, another group of militants struck elsewhere to try to escape, reportedly receiving help from militants outside.

Army officials and the senior security official said they did not know whether Fatah Islam leader Shaker al-Absi was among those who attempted to break out. Al-Absi has not been seen or heard since early in the fighting.

Zuheir Bahsa, who witnessed the fighting from the farming village of Mohammara, which sits on a hill overlooking the northern edge of Nahr el-Bared, said gunfire erupted "from inside and outside the camp." Troops then searched the town's houses and olive groves for fugitives, added the 26-year-old carpenter.

A Lebanese soldier, speaking on condition of anonymity because he was not authorized to speak to the media, said a young militant armed with an AK-47 and hand grenades was captured hiding in the woods near Mohammara.

State television reported that Lebanese residents of nearby villages, armed with guns and sticks, fanned out to protect their houses and prevent militants from melting into the local population. Smoke billowed from a field near the camp where residents said the army set fire to bushes to deny militants a hiding place.

Even in the Lebanese capital Beirut, over an hour's drive to the south, officials searched vehicles at military checkpoints set up on major streets. Other checkpoints went up along the coastal highway linking the north with Beirut, causing traffic jams.

Fighting erupted May 20 between troops and Fatah Islam militants holed up in Nahr el-Bared camp near Tripoli, becoming Lebanon's worst internal violence since the 1975-90 civil war. The battles have killed more than 20 civilians and scores of militants. Families of the militants — women and children — were evacuated late last month, the last civilians to leave the camp.