In the 1970s, the Khmer Rouge were largely supported and funded by the CCP, receiving approval from Mao Zedong; it is estimated that at least 90% of the foreign aid which was provided to the Khmer Rouge came from China. The regime was removed from power in 1979 when Vietnam invaded Cambodia and quickly destroyed most of the Khmer Rouge's forces. The Khmer Rouge then fled to Thailand, whose government saw them as a buffer force against the Communist Vietnamese. The Khmer Rouge continued to fight against the Vietnamese and the government of the new People's Republic of Kampuchea until the end of the war in 1989. The Cambodian governments-in-exile (including the Khmer Rouge) held onto Cambodia's United Nations seat (with considerable international support) until 1993, when the monarchy was restored and the name of the Cambodian state was changed to the Kingdom of Cambodia. A year later, thousands of Khmer Rouge guerrillas surrendered themselves in a government amnesty.