invasion of Cambodia. There was another flood of refugees, and both Vietnamese and Khmer Rouge forces periodically crossed into Thai territory, sparking clashes along the borders. A 1979 visit to Beijing earned Deng Xiaoping's agreement to end support for Thailand's communist movement; in return, the Thai authorities agreed to give safe haven to the Khmer Rouge forces fleeing west following the invasion of Cambodia. Revelations of the crimes of the defeated Khmer Rouge also sharply reduced the appeal of communism to the Thai public. Kriangsak's position as prime minister soon became untenable and he was forced to step down in February 1980 at a time of economic troubles. Kriangsak was succeeded by the army commander-in-chief, General Prem Tinsulanonda, a staunch royalist with a reputation for being incorruptible. Vietnamese incursions Between 1979 and 1988, Vietnamese occupation forces in Kampuchea made incursions into Thai territory, allegedly seeking rebel guerrillas they claimed were hiding in refugee camps (where many Laotians and Vietnamese refugees had also settled). Sporadic skirmishes continued along the border from 1985 to 1988, as Vietnamese troops periodically made cross border raids to wipe out Khmer Rouge border camps in Thailand, which along with China was a major supporter of the Khmer Rouge resistance. At times this led to direct combat with the Royal Thai Army, which drove back the intruders. Prem era (1980–1988) Much of the 1980s saw a process of democratization overseen by King Bhumibol and Prem Tinsulanonda. The two preferred constitutional rule, and acted to put an end to violent military interventions. In April 1981 a clique of junior army officers popularly known as the "Young Turks" staged a coup attempt, taking control of Bangkok. They dissolved the National Assembly and promised sweeping social changes. But their position quickly crumbled when Prem Tinsulanonda accompanied the royal family to Khorat. With King Bhumibol's support for Prem made clear, loyalist units under the palace favourite General Arthit Kamlang-ek managed to recapture the capital in an almost bloodless counterattack.. This episode raised the prestige of the monarchy still further, and also enhanced Prem's status as a relative moderate. A compromise was therefore reached. The insurgency ended and most of the ex-student guerillas returned to Bangkok under an amnesty. In December 1982, the Thai army Commander in Chief accepted flag of the Communist Party of Thailand at a widely publicized ceremony held in Banbak. Here, communist fighters and their supporters handed in