Military spokesman Lt Col Harold Cabunoc said 16 other soldiers were wounded in the daylong fighting in a jungle near Patikul town in Sulu province where the large number of Abu Sayyaf gunmen had gathered.
At least 16 militants were wounded, Cabunoc said, citing army reports.
The Abu Sayyaf gunmen, led by commander Hatib Sawadjaan, have been blamed for several ransom kidnappings, including of two German tourists who were freed in October after six months of jungle captivity, reportedly in exchange for 250 million pesos (USD 5.6 million).
The militants later split into smaller groups as they withdrew and were being pursued by army troops and marines, the military said.
More From This Section
The Abu Sayyaf, a loose grouping of about 400 mostly poor rural fighters, has turned to kidnappings for ransom, extortion and other crimes to survive years of battle setbacks dealt by US military-backed Philippine offensives.
The Sulu-based gunmen are still holding a Dutch birdwatcher who was kidnapped more than two years ago, and a Malaysian police officer who was abducted last year in Malaysia's Sabah state.
At least two of its commanders have pledged support for the Islamic State group, but Philippine security officials say there are no signs so far of any organizational links between the extremists.