An army spokesman said on Sunday that Philippine soldiers battled a group of about 120 Abu Sayyaf militants in a ten-hour assault on a southern island that killed 23 people.
The clashes, described as the worst violence in the troubled south this year, took place on the island of Basilan following an April 8 ransom deadline set by Abu Sayyaf, who had threatened to harm some foreign hostages.
"This is part of the military operations against the Abu Sayyaf," launched after a series of abductions of foreigners, said regional military spokesman Major Filemon Tan.
Another military spokesman said that the soldiers were on their way to attack an Abu Sayyaf hideout when they were ambushed.
"Our group was heading to attack them. On the way, they were ambushed," Colonel Benedict Manquiquis, spokesman for the unit involved in the battle, told radio station DZRH.
"The enemy had the high ground so no matter where our soldiers fled to seek cover, they could still be hit by the heavy firepower and improvised explosive devices of the members of the Abu Sayyaf group," he said.
Major Tan said that 53 soldiers and about 20 Abu Sayyaf militants had also been wounded in the violence, but he did not give details.
The clash came shortly after a retired Italian priest, being held hostage by the Abu Sayyaf, was freed on Friday
Last month Abu Sayyaf militants posted a video on their Facebook page, in which a Norwegian and two Canadian hostages said that they would be killed if the ransom was not paid.
While the ransom amount was not specified, the militants in an earlier video demanded one billion pesos ($21 million) for each of the three foreigners.
Since the April 8 ransom deadline passed there has been no word on the hostages' fate.
Abu Sayyaf is a small group of militants known for kidnapping foreigners and demanding huge sums of ransom.
Eighteen other foreign hostages are being held in the Philippines, most or all of them are thought to be in the hands of the Abu Sayyaf militants.
The group was established in the early 1990s with seed money from Al Qaeda.
The militants have been blamed for the country's worst terror attacks, including a 2004 Manila Bay ferry bombing that claimed 116 lives.
Its leaders, in recent years, have pledged allegiance to DAESH terrorist organisation, which controls vast swathes of Iraq and Syria.