(CNN) Philippines President Rodrigo Duterte will "be the first one to obey" a new law banning sexual harassment, his spokesman said, after critics highlighted the outspoken leader's appalling record on the issue.

The Safe Spaces Act (Republic Act 11313) bans groping, sexual slurs, cat-calling, wolf-whistling, stalking, and making repeated unwanted sexual remarks or advances in all public spaces.

Duterte has been condemned in the past for his sexist statements , including joking that he'd give soldiers a new order to shoot female rebels in the vagina.

Presidential spokesman Salvador Panelo told local media Tuesday that Duterte fully supported the new law, which he signed in April but was only publicized this week.

"Since the President signed that law, it means he recognizes the need for the law. Since he is the chief enforcer of all the laws of the Philippines, he will be the first one to obey the law," Panelo said.

Read More