Following their defeat by Vietnamese forces in January 1979 (not 1978—Vietnam launched its full-scale invasion in late December 1978, capturing Phnom Penh on January 7, 1979), the Khmer Rouge leadership and remnants of their army fled westward into Thailand.
They established sanctuary camps along the Thai-Cambodian border, from which they waged a guerrilla insurgency against the new Vietnamese-backed People's Republic of Kampuchea for over a decade, with covert support from China, the U.S., and ASEAN nations opposed to Vietnamese expansion.
The Khmer Rouge retained Cambodia's UN seat until 1991, despite their ouster.