Tens of thousands of Cambodians working in Thailand have fled the country in a chaotic exodus that appears to be driven by fears of a crackdown on illegal foreign laborers by the military junta that seized power in Thailand last month.

The abrupt departures threaten to strain relations between the two countries and could hurt both Thai industries that rely on Cambodian workers and the Cambodian economy, which benefits from the workers’ remittances.

“It has been chaos,” Anek Manusnirobon, the head of customs at the Aranyaprathet border checkpoint, said on Sunday. Mr. Anek added that officials opened extra departure lanes after the line of trucks and buses leaving the country reached four kilometers, or more than two miles.

The exodus appears partly to stem from a lack of trust in official announcements in military-ruled Thailand, where the junta censors television broadcasts and bars any criticism of the coup. The generals seized power last month after months of denying they had any plans for a coup.