The Philippines vowed to destroy those behind twin bombings that killed 20 people during a Sunday church service in the country's restive south, six days after a referendum on autonomy for the mainly Muslim region returned an overwhelming "yes" vote.
The attack wounded more than 100 people and was one of the deadliest in recent years in a region long plagued by instability. It came amid hope and excitement about the ratification of a devolution plan that aims to bring development, jobs and peace to one of Asia's poorest and most volatile places.
The first explosion went off inside the cathedral on Jolo island, in Sulu province, and was followed by a second blast outside, which was detonated as security forces raced to the scene, officials said.
"The enemies of the state have boldly challenged the capability of the government to secure the safety of the citizenry in that region," said Salvador Panelo, spokesman of Philippine President Rodrigo Duterte.
"The armed forces of the Philippines will rise to the challenge and crush these godless criminals."
Islamic State claimed responsibility for the attack via the militant group's Amaq news agency, describing it as twin suicide bombings that it said killed 120 people.
Police are investigating but suspect it was the work of Abu Sayyaf, a domestic militant group that has pledged allegiance to Islamic State and is notorious for its bombings and brutality.
"They want to show force and sow chaos," national police chief Oscar Albayalde told DZMM radio, suggesting Abu Sayyaf was the prime suspect.
Civilians bore the brunt of the attack, which also killed five soldiers. Police lowered the death toll from 27 to 20, after discovering duplications in initial records.
Jolo is a stronghold of the group, which runs a lucrative piracy and kidnapping operation that successive governments have failed to break up. The group, which operates in the waters and islands of western Mindanao, has beheaded numerous foreign captives when ransom demands were not met.
Images of the inside of the Jolo church showed several rows of wooden pews destroyed, with debris strewn across a blackened floor.
Speaking in Panama, Pope Francis condemned what he called a "terrorist attack" and during a prayer for the dead and wounded said: "May the Lord, prince of peace, convert the hearts of the violent ones."
The attack followed Friday's announcement that the region, a mainly Muslim part of the predominantly Catholic Philippines, had ratified the creation of an autonomous area called Bangsamoro, with 85 percent of voters behind it.
Although Sulu was among only a few areas that rejected autonomy, it will still be part of the new entity when it is fully formed in 2022.
Defence Secretary Delfin Lorenzana called the attack a "dastardly act" and urged the local population to cooperate and "deny terrorism any victory".
National Security Adviser, Hermogenes Esperon, called those responsible "mass murderers" and "extremist criminals".
"We will not allow them to spoil the preference of the people for peace," he added.
The referendum came amid concerns about the presence of extremists in the Philippines and the possibility that foreign radicals will join those of Indonesia and Malaysia in gravitating to Mindanao to capitalize on porous borders, jungles and mountains, and an abundance of arms.
The Philippine military in mid-2017 encountered its biggest and longest battle since World War Two when an alliance of extremists loyal to Islamic State, among them foreigners and children, overran Marawi City and tried to establish a caliphate.
Isnilon Hapilon, an Abu Sayyaf faction leader anointed as Islamic State's Southeast Asian "emir" and wanted by the United States, was killed during that battle.