BANGKOK -- Foreign tourists in Thailand will be required to use a special SIM card for their mobile phones that could be used to track their movements during their stay, the telecom regulator said on Tuesday.

This SIM card has been specially programmed to transmit information about its whereabouts once it is inserted in the phone. This function cannot be turned off when the SIM is in use.

All foreigners in Thailand, excluding expats with permanent addresses, will be required to purchase the special card, Thakorn Tantasith, secretary general of the National Broadcasting and Telecommunication Commission said.

"It will benefit the government authority by being able to trace the location of tourists who have illegally extended their stays or criminals who have fled to Thailand to escape," he said. It will also be easier to track tourists who stay in multiple locations during their stay, he added.

But in order to obtain the tourists' locations, police and any authority will need a court order. If a telecom operator reveals information without a court order, its officials will be penalized with a five-year jail term. "If the tourist has not done anything wrong, there's nothing to worry about to begin with," Thakorn said.

The idea was hatched at a meeting of telecom regulators from the countries in the Association of Southeast Asian Nations. Thakorn said the idea came from his counterparts in Singapore and Malaysia. He claimed that the two countries have already introduced the cards. The scheme could become an ASEAN-wide one, but Thailand had decided to go ahead on its own first, he said.

"There is a lot going on in the world like Isis [referring terror attacks by to the Islamic State group]. We need to do something, it's for national security," Korkit Danchaivichit, NBTC deputy secretary general, added.

The new scheme could start in six months' time, after public hearings with telecom companies and tour operators followed by approval from the NBTC board.

The telecom operator also plans to shorten the life cycle of tourist SIM cards from the current 90 days to as short as 30 days, in order to be able reuse numbers sooner. This is to cope with the shortage of mobile numbers in the country, where smartphone usage has exploded over the past few years.