Updated

A deadly three-week standoff between government troops and Muslim rebels who held nearly 200 people hostage in the southern Philippines has ended with all of the remaining captives safe, officials said Saturday.

Defense Secretary Voltaire Gazmin said only a handful of Moro National Liberation Front rebels remained in hiding and were being hunted by troops in the coastal outskirts of Zamboanga city. He said authorities were trying to determine whether rebel commander Habier Malik, who led the Sept. 9 siege, was dead. Gunshots briefly rang out and a fire erupted in a small area Saturday.

More than 200 people were killed in the clashes, including 183 rebels, 23 soldiers and police, and 12 civilians. It was in one of the bloodiest and longest-running attacks by a Muslim group in the southern Philippines, the scene of a decades-long Muslim rebellion for self-rule in the largely Roman Catholic country.

"I can say that the crisis is over. We have accomplished the mission," Gazmin said by telephone from Zamboanga, where he helped oversee a government offensive and hostage rescue mission by about 4,500 government troops and police backed by tanks, navy gunboats and rocket-firing helicopters.

Gazmin said 195 hostages had either been rescued, managed to escape or were freed. It was unclear whether any of the 12 civilians killed in the standoff were hostages.

The gunbattles, including exchanges of grenade and mortar fire, forced about 130,000 residents — more than 10 percent of the population of the bustling port city — to flee their homes to emergency shelters, including Zamboanga's main sports complex. About 10,000 houses were burned by the rebels or destroyed in the fighting, which raged in a 30-hectare (74-acre) area encompassing six coastal communities, according to Interior Secretary Mar Roxas.

Cornered and outnumbered, the rebels sought help from their comrades from nearby provinces, but guerrilla reinforcements were repulsed, Gazmin said.

Police and troops still have to clear areas of the dangerous leftovers from the fighting, including unexploded bombs, guns, grenades and possible booby traps, Roxas said, adding that it may be up to two weeks before residents are allowed to return home.

Gazmin, Roxas and military chief of staff Gen. Emmanuel Bautista briefly toured the scene of the most intense gunbattles Saturday in Zamboanga's Santa Catalina community, which was turned into a wasteland after nearly 100 rebels died in clashes there. Army soldiers retrieving dead guerrillas wore gas masks because of the stench from the bodies.

All the houses in the vast community were either burned by the rebels in daily infernos or damaged by gunfire and mortar blasts. Atop a bullet-peppered building, troops raised a Philippine flag at half-staff.

"The rebel siege is over and Zamboanga is free again," Roxas told reporters.

Bautista paid tribute to his soldiers, including 18 who were killed and 169 wounded in the clashes. Bautista's father was an army general who was shot to death with more than 30 of his men in a 1977 massacre by the same Muslim rebel group on nearby Jolo island.

The siege in Zamboanga, about 860 kilometers (540 miles) south of Manila, began when heavily armed insurgents arrived by boat from outlying islands but were blocked by troops and policemen, who discovered what authorities said was a rebel plan to occupy and hoist their flag at Zamboanga's city hall. The rebels then stormed coastal communities and took residents hostage and were surrounded by troops.

President Benigno Aquino III ordered an offensive that began on Sept. 13 after the rebels refused to surrender and free their hostages.

The rebel faction involved in the fighting dropped its demand for a separate Muslim state and signed an autonomy deal with the government in 1996, but the guerrillas did not lay down their arms and later accused the government of reneging on a promise to develop long-neglected Muslim regions.

The faction's leader, Nur Misuari, has not surfaced since the siege began, but will be prosecuted along with 292 captured guerrillas for rebellion and violating international humanitarian laws that forbid the taking civilians hostage for use as human shields.

Military spokesman Lt. Col. Ramon Zagala said the estimated 300 million pesos ($7 million) that was spent by the armed forces to contain the rebel threat proved that the government will do everything to protect the country's sovereignty.

"These rebels dared to challenge our very sovereignty by raising their flag," Zagala said. "We'll never allow that to happen at any cost."