"Do not surrender alive," he told soldiers after turning over 3,000 units of 45-calibre pistols for the military. "I will give you a pistol with three magazines, but remember one is for you and two is for the enemies."
Duterte said soldiers, especially those deployed in the southern Philippines, should not give Islamist militants the opportunity to execute and behead them, which the terrorists film and later on release on the internet.
"It is very horrifying and traumatic for (family members) to see that," he said. "I don't mind losing the guns to the enemies, but don't give the guns to them alive. Never allow yourself to be degraded."
Nearly 100 soldiers have been killed in almost two months of fighting with hundreds of Islamic State-allied militants in Marawi City, 800 kilometres south of Manila.
Troops have killed more than 400 militants, who have executed 45 civilians since the fighting started on May 23. Some of the executions have been filmed by the militants and released on the internet, the military said.