Earlier, Duterte broke off midway through a prepared speech at the Hero's Cemetery on the outskirts of Manila and addressed impromptu comments to Jovie Espenido, the police chief of a town in the south where the mayor was killed in an anti-drugs raid.
"Your duty requires you to overcome the resistance of the person you are arresting... (if) he resists, and it is a violent one... you are free to kill the idiots, that is my order to you," Duterte told the police officer.
Duterte added that "murder and homicide and unlawful killings" were not allowed and that police had to uphold the rule of law while carrying out their duties.
Duterte unleashed the anti-drugs war after taking office in June last year following an election campaign in which he vowed to use deadly force to wipe out crime and drugs.
Thousands of people have been killed and the violence has been criticized by much of the international community.