Hundreds of Northern Alliance troops — and some American soldiers — continued the bloody struggle Tuesday to put down a suicidal prison insurrection by foreign militants that raged into its third day. 

Five Americans were wounded by a stray U.S. bomb and one CIA operative was missing in the uprising, according to a U.S. official speaking on condition of anonymity.

Tuesday morning, the rattle of machine-gun fire rang out, and billowing clouds of dust and smoke rose from inside the fortress after apparent mortar strikes. Earlier, an enormous blast shook windows in Mazar-e-Sharif, 10 miles away. Planes circled overhead. Sounds of fighting could be heard all night from the direction of the fortress.

Only a few dozen of the Pakistani, Chechen and Arab fighters loyal to Usama bin Laden were believed to be still alive in the Qalai Janghi fortress about 10 miles outside Mazar-e-Sharif, but they were firing rocket-propelled grenades and mortars from a tower at their erstwhile captors. 

Originally, hundreds of foreigners fighting with the Taliban were brought to the fortress as part of the weekend surrender of Kunduz, the Islamic militia's last stronghold in the north.

Once inside the fortress Sunday, the prisoners stormed the armory and were still resisting the next day despite U.S. airstrikes and attacks by alliance forces.

American special forces troops called in an airstrike but a U.S. JDAM smart bomb went astray, exploding near the Americans. Five U.S. soldiers suffered serious wounds and were evacuated to nearby Uzbekistan, Gen. Richard Myers, chairman of the U.S. Joint Chiefs of Staff, said in Washington. Their identities were not released.

Alliance officers said about 40 of their troops had died in the uprising along with hundreds of resisters. Alliance commanders said the holdouts, trapped in a tower, were running out of ammunition and wouldn't last long.

"Those who are left over will be dead," said Alim Razim, an aide to alliance Gen. Rashid Dostum. "None of them can escape."

The fighting was fierce Monday afternoon. At one point, a group of soldiers could be seen running into one part of the fort under the cover of machine-gun fire. Fifteen minutes later, mortar shells began to explode and they made a hasty retreat. 

Alex Perry, a journalist for Time magazine who was inside the fort during the uprising, said 800 people were involved in the fighting, and that an American soldier was killed. 

"There were two American soldiers inside the fort: one of whom was disarmed and killed — he was called Mike," Perry reported on the Web site Time.com. 

Footage taken by a crew from Germany's ARD television network Sunday showed a U.S. special forces soldier inside the fortress telling his commanders he believed an American had been killed. 

"There's hundreds dead here at least," the bearded soldier, who identified himself only as David, could be heard saying on Germany's ARD television network as he called in airstrikes and reinforcements. 

"I don't know how many Americans there were. I think one was killed, but I'm not sure," the U.S. soldier said in the footage. "There were two of us at least — me and some other guy." 

The Associated Press contributed to this report