At least 18 people have been killed in two bombs at a church on a southern Philippine island that is a stronghold of Islamist militants.
The first blast occurred inside the Catholic church on war-torn Jolo on Sunday morning as mass was being celebrated, and was followed by a second explosion outside as troops responded, the regional military spokesman said.
Most victims were churchgoers along with soldiers. The door, pews and glass windows of Mount Carmel Cathedral were blown off, military photos showed, with bodies strewn across the ground, according to an AFP photographer on the scene.
President Rodrigo Duterte's spokesman condemned the incident as an "act of terrorism and murder".
"We will pursue to the ends of the earth the ruthless perpetrators behind this dastardly crime until every killer is brought to justice and put behind bars. The law will give them no mercy," Salvador Panelo said in a statement.
Five soldiers, a member of the coast guard and 12 civilians were killed while 83 others were wounded, said regional military spokesman Lieutenant Colonel Gerry Besana.
However the regional police chief Graciano Mijares put the death toll at 27, with 77 people wounded.
The second bomb was left in the utility box of a motorcycle in the parking area outside the church, a military report said.
The army said it airlifted some of the wounded to the nearby city of Zamboanga for medical treatment.
Authorities said the notorious Abu Sayyaf kidnap-for-ransom group could be behind the blasts.
"When you talk about terrorism in Sulu, the primary suspect is always the (Abu Sayyaf) but we are not discounting the possibility that there are other perpetrators," Besana told AFP.
Jolo is a base of the Abu Sayyaf, which is blamed for deadly bombings, including an attack on a ferry in Manila Bay in 2004 that claimed 116 lives in the country's deadliest terror assault.
The Abu Sayyaf is a loose network of militants formed in the 1990s with seed money from Osama bin Laden's Al-Qaeda network, and has earned millions of dollars from banditry and kidnappings-for-ransom, often targetting foreigners.
It is among armed groups based in the strife-torn region of Mindanao, some of whose members have pledged allegiance to the Islamic State group.
Jolo also lies in the proposed Bangsamoro Muslim-majority autonomous region, which local voters overwhelmingly approved last week.
Voters ratified a law creating a new autonomous region in the Philippines' south, raising hopes that the move will bring peace and development to the impoverished area after decades of fighting left thousands dead.
Sulu province -- which includes Jolo -- voted against the creation of the new region, with its governor filing a petition in the Supreme Court to prevent its formation.
Despite Sulu's vote, the province is legally required to join Bangsamoro because voters from across the current autonomous region voted in favour of it on the whole.
Sunday's bombing comes after a New Year's eve blast in the southern Philippine city of Cotabato killed two people and wounded 35 others.
Cotabato last week voted to be included in the new autonomous region.
The timing of Sunday's bombs raised questions on whether the attack was meant to derail the peace process.
Mujiv Hataman, governor of the current autonomous region in Muslim Mindanao, said the blasts highlighted the urgency of implementing the peace law.
"Terrorists want to make their presence known. I hope the (law) is implemented well so it could be a solution to stop the spread of terrorism," Hataman told AFP.