The military said the kidnap-for-ransom group and IS-affiliate Abu Sayyaf was likely behind the midday blast on the island of Jolo, which also left nine other soldiers wounded.
IS claimed the bombing was the work of two suicide attackers, according to tweets from Rita Katz, the director of SITE Intelligence Group which monitors jihadist activities worldwide.
The Philippines has renewed its campaign against the militants on Jolo this year after a suspected suicide bomber struck the island’s Roman Catholic cathedral in January, killing 21 people.
The country is home to numerous armed groups, several of which are linked to the decades-old insurgency aiming to create a Muslim homeland in the Christian-majority nation’s deep south.
Friday’s blast blew the roof off the sentry gate of the military camp and blackened its concrete walls, according to photographs of the aftermath of the attack shown on local television.
Three members of the military unit were killed and nine others were wounded, while two civilians — a motor tricycle driver and a woman street vendor — also died in the attack, army spokesman Colonel Ramon Zagala told AFP.
“This attack is meant to disrupt the intensified security operations and our operational tempo following (a) series of recent operational gains in the area,” Zagala said in a separate statement.
An AFP reporter on the scene saw a blood-soaked man slumped beside a gore-covered motorized tricycle parked on a street outside the temporary headquarters of the 1,500-member First Brigade Combat Team.
The authorities could not say what kind of explosives were used.
Abu Sayyaf was active in the Philippines years before linking up with Islamic State, and has supported its violent activities with kidnapping.
The group has held hostages over the course of years and negotiated ransoms, but has also shown a willingness to kill its captives.
In the same week, a Dutch birdwatcher held for years by the Abu Sayyaf was killed on Jolo during a firefight between his kidnappers and soldiers sent to rescue him.