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.
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.