Philippine troops hunted the remnants of a Muslim rebel group in the key southern city of Zamboanga on Sunday, with residents hearing gunfire a day after the military declared an end to its three-week campaign.

The army Saturday announced that police were taking over from troops to clear sections of the city, a vital regional trading centre, of Moro National Liberation Front (MNLF) stragglers.

But, just minutes after the military said the threat to Zamboanga was over, soldiers killed three MNLF fighters in a clash that also left six troops wounded.

"What happened was not organised resistance. These are stragglers trying to escape capture," Lieutenant-Colonel Ramon Zagala told AFP Sunday, adding that only a handful of rebels remained.

"The mission is completed. We have already neutralised the threat to Zamboanga City."

In Manila, President Benigno Aquino's communications secretary Ramon Carandang also warned of the danger of stragglers, saying: "It's not completely over yet".

Fighters swarmed into the city's neighbourhoods 20 days ago, taking hostages and triggering weeks of violence as they sought to derail peace talks between the government and a rival guerilla rebel faction.

More than 10,000 homes were razed to the ground, forcing over 100,000 people -- around a tenth of the city's population -- to flee.

The latest clash put the toll at 189 MNLF fighters killed, with 292 captured or surrendering, while 23 soldiers and police and 12 civilians had also been slain.

A total of 195 civilian hostages were rescued, and authorities believe there are no more still in the hands of the gunmen, said Zagala.

The military said Nur Misuari, who founded the MNLF in the early 1970s, had sent hundreds of armed followers led by his top lieutenant, Habier Malik, to Zamboanga.

Malik's identification card had been found on the body of a slain MNLF member, Zagala said, though it was too early to confirm his death and forensic examinations were being carried out.

The conflict area -- 30-40 hectares (74-99 acres) of densely packed communities, mangrove swamps and ponds -- could take about two weeks to clear of possible MNLF stragglers, unexploded bombs, booby traps and the buried bodies of dead gunmen, he said.

The clearing operation started with explosive experts and bomb-sniffing dogs checking a government hospital that was at the border of the occupied area. An unexploded 40mm grenade shell was found on the hospital's roof, journalists on the scene said.

Muslim rebels have been fighting since the 1970s for an independent or autonomous homeland in the south of the mainly Catholic Philippines. An estimated 150,000 people have died in the conflict.

The MNLF signed a peace treaty in 1996 that granted limited self-rule to the south's Muslim minority.

However, the group is opposed to a planned final peace deal between the government and the remaining major Muslim rebel group, the 12,000-strong Moro Islamic Liberation Front (MILF).

The MNLF believes the deal could leave it sidelined.