Lebanon says it has "crushed" a group of Islamist fighters based in a Palestinian refugee camp after a month-long battle.
Much of Nahr al-Bared has been destroyed during the fighting
Leaders of Fatah al-Islam are on the run and military operations at the Nahr al-Bared camp are over, Defence Minister Elias Murr said.
Muslim clerics acting as mediators said Fatah al-Islam had agreed a ceasefire.
More than 150 people died, including at least 20 civilians, in Lebanon's worst violence since the 1975-90 civil war.
Mr Murr told Lebanese TV that the army had "crushed those terrorists".
He added: "What is happening now is some clean-up that the army's heroes are carrying out, and dismantling some mines."
A group of Palestinian Muslim clerics that had tried to mediate during the clashes, said Fatah al-Islam had declared a ceasefire.
One of the clerics, Sheik Mohammed Haj, told Associated Press news agency that the militants would "comply with the Lebanese army's decision to end military operations".
Troops would continue to pursue the leaders and remaining fighters of Fatah al-Islam, Mr Murr said.
He said they were believed to be hiding deep within the refugee camp among the civilian population, suggesting some clashes could still flare up inside the camp as a result.
Split from Palestinian group Fatah al-Intifada in late 2006
Believed to have 150-200 armed men, based in Nahr al-Bared camp
Denies al-Qaeda links but says it endorses its ideas
Has links with Syrian intelligence, Lebanon says
Leader is Shaker al-Abssi
Nahr al-Bared, near the northern city of Tripoli, was home to 31,000 people before the fighting broke out. Approximately 2,000 refugees are now believed to be inside the camp.
Large parts of the camp have been left in ruins after a bitter struggle that began in late May when the Lebanese army tried to arrest a number of alleged members of Fatah al-Islam.
Lebanon has 12 refugee camps housing more than 350,000 Palestinians, many of whom fled or were forced to leave their homes when Israel was created in 1948.
There is a long-standing convention that Lebanon's army does not go into the camps, leaving security inside to militant groups.
The Lebanese government believes Fatah al-Islam is backed by Syrian intelligence, a claim Syria denies.
Also on Thursday, Syria closed a border crossing in the north-east of Lebanon for "security" reasons.
Damascus closed two other crossings when fighting first broke out in the camp, also for safety reasons. Only the Masnaa crossing remains open.