Hospital sources said 12 soldiers from the force that stormed the flat were wounded, including at least one seriously.
"The Palestinian refugees are not being treated properly by Lebanon"Sunny, Ottawa, CanadaSend us your views
Lebanese army units blocked off roads leading to the area and brought in reinforcements, including armoured troop carriers.
The shooting eased some 30 minutes later and sources said the gunmen were holed up inside a building.
It follows a day of more heavy shelling and street to street fighting in the Nahr al-Bared camp.
Four Lebanese soldiers died despite the defence minister's claims of victory two days ago.
At least 176 people have been killed in the fierce fighting between the army and Fatah al-Islam at Nahr al-Bared refugee camp.
It is unclear how many civilians have died inside the camp as security forces are barred from entering Lebanon's 12 Palestinian refugee camps by a decades-old Arab agreement.
Khodr said: "There are real fears in Lebanon that the crisis may spill out of the refugee camp.
"We do know that many officials have warned that there could be a rise in the presence of al-Qaeda in Lebanon."
Saturday's deaths are the first military fatalities since Elias Murr, Lebanon's defence minister, declared in a TV interview on Thursday that Fatah al-Islam had been "crushed".
He said the Lebanese army was concentrating on "clean-up" operations against Fatah al-Islam remnants, after 33 days of fighting.
The army said on Thursday it would not end the siege of the camp until the fighters surrendered.
Palestinian mediators held talks on Friday with Fatah al-Islam at the camp and were due to hold more talks over the weekend to find a solution acceptable to the army and Fatah al-Islam.
At least 31,000 Palestinian refugees normally live in the camp, but most have fled from the constant Lebanese army shelling to the nearby Beddawi refugee camp.
The battle for Nahr al-Bared is Lebanon's worst internal violence since the end of the 1975-90 civil war.