The announcement of martial law comes after security forces battled dozens of IS-linked gunmen in a Marawi, a city of about 200,000 people in Mindanao.
The Philippines delegation led by Duterte is on a four-day visit to Russia to discuss deals on security, military cooperation, trade, technology and tourism.
According to Article 112 of Thailand's criminal code, anyone who insults the king, queen, heir or regent will be punished with up to 15 years in prison for each offence.