It was not clear what prompted the exchanges. Until sundown Thursday, only sporadic gunfire marred the truce.

Earlier in the day, the Lebanese army moved troops around the Nahr el-Bared camp but did not try to advance, apparently giving time for negotiations and for the militants to comply with a government ultimatum to surrender or face a military assault.

The renewed exchanges also came as both sides dug in in their positions — the government determined to root out the militants and the fighters refusing to surrender.

Prime Minister Fuad Saniora vowed in a speech Thursday to wipe out the militants barricaded in the camp, raising the prospect that the Lebanese army will either storm the camp, in what would likely be a bloody battle, or dig in for a long siege to force their surrender.

Fighters from the al-Qaida-inspired Fatah Islam militant group, estimated in the hundreds, say they will fight off any Lebanese attack.

The fighting between the army and the militants, which broke out Sunday, has killed some 50 combatants and many civilians. Thousands of Palestinian civilians — mainly women and children — have fled the camp on the outskirts of this northern port, but many thousands remain inside.

Most of the thousands of Palestinian refugees who have fled the Nahr el-Bared camp since the truce took hold Tuesday packed into the nearby Beddawi refugee camp, lining up at U.N.-run schools and clinics with registration cards, hoping to get food and mattresses. The camp’s six schools were overflowing with refugees who said that up to 50 people were sleeping in each classroom.

More refugees trickled out of Nahr el-Bared Thursday. They packed into a few pickup trucks or walked out to the first army checkpoints where they were checked and allowed to proceed.

“How many times do we have to be displaced?” cried Palestinian refugee Nohad Abdel-Al, clad in a black robe and a black head scarf. “Have mercy on us! Have mercy on us,” she told the troops, holding an infant in her arms.

Her husband, Bakri Abdel-Al, said the family’s two-story house had been destroyed and that they had decided to leave “because we are now hearing the fighting will resume.”

Amid media reports of Muslim clerics negotiating with the militants to avert an army onslaught, Lebanon’s government appeared to be preparing for a showdown, including the possible storming of the camp. The Lebanese military stays out of the camps under a 1969 agreement that allows the Palestinians to run them.

Saniora said in a TV address that Fatah Islam was “a terrorist organization” and blamed the group for “attempting to ride on the suffering and the struggle of the Palestinian people.”

“We will work to root out and strike at terrorism, but we will embrace and protect our brothers in the camps,” Saniora said, insisting Lebanon has no quarrel with the 400,000 Palestinian refugees in the country.

Storming the Nahr el-Bared camp — a densely built-up town of narrow streets on the Mediterranean coast — could mean rough urban fighting for Lebanese troops and further death and destruction for the thousands of civilians who remain inside.

It could also spark unrest in Lebanon’s 11 other Palestinian refugee camps. Although Palestinian factions have dissociated themselves from Fatah Islam, refugees in other camps, which are rife with armed groups, were seething with anger over the army bombardments that have partially destroyed Nahr el-Bared.

In a sign of the danger, a bomb exploded Wednesday night in the Aley mountain resort overlooking Beirut, a 90-minute drive south of Nahr el-Bared. The blast, which injured 16 people, was the third in the Beirut area since Sunday. One person has been killed and a dozen injured in the two other attacks.

Fatah Islam has denied responsibility for the bombings, but it had threatened to take the battle outside Tripoli if the army attacks.

A senior army official disclosed Thursday that troops had sunk two small boats carrying Fatah Islam militants who tried to flee from the camp on Tuesday via the sea. The official said all passengers on the two dinghies were killed, but did not specify how many had died.