In 2004, long-simmering resentment in the southern-most Muslim-majority provinces burst into violence in Narathiwat, Pattani and Yala provinces. All are off the beaten tourist trail, although the eastern rail line from Hat Yai to Sungai Kolok (gateway to Malaysia's east coast) passes through the area and has been disrupted several times by attacks. The violence was at its worst between 2004-2015 and is now dying down.
Hat Yai (Thailand's largest city in the South) in Songkhla has also been hit by a series of related bombings; however, the main cross-border rail line connecting Hat Yai and Butterworth (on the west coast) has not been affected, and none of the islands or the west coast beaches have been targeted.
In September 2006, three foreigners were killed in bombings in Hat Yai. Some rebel groups have threatened foreigners, but while targets have included hotels, karaoke lounges and shopping malls, Westerners have not been singled out for attacks. There are Islamist and jihadist groups in south Thailand, such as Jemaah Islamiyah. That said, there is usually a strong Thai military presence in the major towns and cities to keep things in order, and the vast majority of foreign visitors do not encounter any problems.
In 2015, Uyghur Islamist separatists also carried out a terrorist attack in Bangkok the Erawan Shrine, a site popular with Chinese tourists. This is, however, largely regarded as an isolated incident, and the odds of it happening again are regarded as remote.
While Thailand's deep south provinces remain under emergency law, as of 2022 there is no elevated risk to tourists visiting these areas. Military checkpoints still exist and soldiers are still posted in public places and on trains, but they do not bother tourists.