At least seven marines and five militants were killed as troops fought an Abu Sayyaf group in the southern Philippines, the military says.
Nine other marines and a number of Abu Sayyaf fighters were wounded, a local military commander said.
A firefight broke out near the coastal town of Patikul in Sulu province as troops tracked the militants, he said.
Abu Sayyaf, an Islamist militant group, has carried out several recent kidnappings.
Kidnaps for ransom
Military spokesman Brig Gen Domingo Tutaan said the early morning gun battle raged for an hour in a village on the outskirts of Patikul.
The marines were hunting down Abu Sayyaf members, who were believed to be behind recent kidnappings for ransom in the area, he said.
These include the abduction of the wife of a marine, who was freed unharmed two days after she was seized, he added.
Colonel Jose Joriel Cenabre, commander of Joint Task Force Sulu, said dozens of militants had taken cover near a row of houses.
"There were a lot of civilians near the enemy, so we couldn't fire on them," said Joemar Monte, one of the injured marines.
Abu Sayyaf is considered the smallest but the most radical of the extremist movements in the southern Philippines.
The group is active in the impoverished region, where minority Muslims have been fighting for self-rule for decades.
The US government considers it a terrorist group, and says it has links with al-Qaeda.
The main Muslim separatist group, the Moro Islamic Liberation Front, last year signed a peace accord with the government in exchange for broad autonomy.
But Abu Sayyaf was among the rebel groups who refused to sign up to the peace deal.