The effort to rescue Thais from chaos in neighbouring Myanmar comes after at least 30 Thais, most of them farm workers, were killed during the Oct. 7 rampage by the Hamas militants in southern Israel. Sixteen Thais were wounded and 17 are among hostages taken by the Palestinian militants.

Heavy fighting erupted last week in northern Myanmar's Shan State where an alliance of ethnic minority forces battling for self-determination launched a series of coordinated attacks on junta positions.

Myanmar's ruling military says it has lost control of several towns on the border, including Chinshwehaw, neighbouring China's Yunnan province.

The United Nations said Friday more than 23,000 people had been newly displaced by the fighting, while Myanmar media outlets said thousands had fled to China.

Chinese media reports said displaced people were forming long queues to enter the country and some Chinese towns nearby were ready to evacuate should the conflict escalate further.

China's foreign ministry on Thursday urged all parties to "immediately cease fire", resolve the conflict through dialogue and ensure the stability of the border.

In a joint statement, the "three brotherhood alliance" said the assault was intended to overthrow "dictatorial rule" in Myanmar and target criminal gangs running telecoms scams they said were protected by the junta.

The area has become a hub for telecoms and other online fraud in recent years, and China has ramped up efforts to curb the crime, rounding up hundreds of suspects.

Thai Prime Minister Srettha Thavisin has told the embassy in Myanmar to work with authorities to "help 162 Thais" and organize shelters in safe areas, the prime minister's office said on social media late on Thursday, adding that Thai and other nationals were "stuck" because of the fighting.

"Right now, the embassy is discussing ways to help all Thais return home quickly," the office said.

At a news conference on Friday, deputy prime minister and foreign minister Parnpree Bahiddha-Nukara said he did not know what the Thai nationals were doing in northern Myanmar but there were probably "many types of work".

Myanmar's junta did not immediately respond to a request for comment.

Myanmar has been in chaos since a military coup in February 2021 unseated a democratically elected government led by Nobel laureate Aung San Suu Kyi.

Newly formed pro-democracy insurgent groups have in some areas teamed up with ethnic minority guerrillas who have been campaigning for decades for greater autonomy.

(Reporting by Panu Wongcha-um in Bangkok and Chen Lin in Singapore; writing by Poppy McPherson; editing by Robert Birsel and Raju Gopalakrishnan)