Authorities in the Philippines are hunting for more than 100 prisoners who escaped a jail on the island of Mindanao last night, after armed men stormed the facility.

The late-night breakout occurred in Kidapawan City, near President Rodrigo Duterte's home town of Davao.

Six of the 158 escapees were killed in firefights with pursuing police and army troops, while eight others were caught and returned to the facility, said senior inspector Xavier Solda, spokesman for the Bureau of Jail Management and Penology.

Army troops and police were searching for the others.

Inspector Solda said the heavily armed gunmen emerged from a forest and attacked the North Cotabato District Jail in Kidapawan under the cover of darkness.

Prison officials said the majority of inmates escaped from the back of the jail as guards were fighting off attackers at the front.

Kidapawan police chief Superintendent Leo Ajero said gunfire continued for hours after the attack as army troops and police, some in armoured tanks, hunted through the surrounding forests for the escaped inmates and the gunmen who freed them.

Acting Provincial Jail Warden Superintendent Peter John Bongngat said the attackers were suspected to include members of the outlawed Bangsamoro Islamic Freedom Fighters and guerrillas who broke away from the main Moro Islamic Liberation Front, which has signed a peace deal with the Government.

'We heard the gunfire and we sprang into action'

Local village leader Alexander Austria said he and his men captured one of the men.

He said the exchanges of gunfire woke his village, which was several kilometres from the prison, and he immediately posted guards because of worries the attackers and escaped inmates could enter the village.

"We heard the gunfire and we sprang into action to guard our village," Mr Austria said.

"We were afraid the escapees could try to enter our village to hide or take hostages."

The jail held more than 1,500 inmates.

Philippines prisons had a major overcrowding problem even before Mr Duterte began his brutal crackdown on drug users and alleged dealers.

AP