Pol Pot's soldiers fled to Thailand and they were welcomed by the Thai's who feared a Vietnamese invasion. The Khmer Rouge continued a guerrilla war against the Vietnamese. However the Vietnamese forces withdrew from Cambodia in 1989.
Afterwards negotiations began among several different parties. The result was the Paris Peace Accords of 1991. Communism was abandoned in Cambodia and a provisional government ruled until 1993 when elections were held and a constitution was framed. Sihanouk was made a constitutional monarch.
However the Khmer Rouge refused to take part in the elections and they continued their guerrilla war. Fortunately in 1996 Pol Pot's second in command Ieng Sary defected in 1996. Many Khmer Rouge troops followed him. Pol Pot himself died in 1998 and peace returned to Cambodia.