A deadly three-week battle between government troops and Muslim rebels who held nearly 200 people hostage in the southern Philippines has ended with all of the captives safe, the country's defence secretary said.

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 if rebel commander Habier Malik, who led the September 9 siege, was dead.

More than 200 people were killed in the clashes, including 166 rebels, in one of the bloodiest and longest-running attacks by a Muslim group in the south, scene of decades-long Muslim rebellion for self-rule in the largely Roman Catholic country.

Download the new Independent Premium app Sharing the full story, not just the headlines

"I can say that the crisis is over. We have accomplished the mission," Mr Gazmin said from Zamboanga, where he helped oversee a government offensive and hostage rescue mission by about 4,500 government troops and police.

He said 195 hostages were rescued, escaped or were freed.

The gun battles, including exchanges of grenade and mortar fire, forced more than 100,000 people - nearly 10 per cent of the population of the bustling port city - to flee their homes to emergency shelters, including Zamboanga's main sports complex. Thousands of houses were destroyed in the fighting.

Police and troops still have to clear areas of the dangerous leftovers of the fighting, including unexploded bombs and possible booby traps, Mr Gazmin said.

The siege began when heavily armed insurgents arrived by boat from outlying islands but were blocked by troops and police, who discovered what authorities said was a rebel plan to occupy and hoist their flag at Zamboanga's city hall.

The rebels then stormed five coastal communities and took residents hostage and were surrounded by troops.

President Benigno Aquino, who flew to Zamboanga, ordered an offensive 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.

AP