In 1979, after Vietnam's military occupation of Cambodia Bangkok allied itself with the Khmer Rouge, an adversary of Vietnam and looked to Beijing for security assistance. In both instances, Thailand's actions hardened Hanoi's attitude toward Bangkok. As the ASEAN member most vulnerable to a hypothetical Vietnamese attack for having given shelter to the Khmer Rouge in camps within its territory, Thailand was foremost among the ASEAN partners opposing Vietnam's 1978 invasion of Cambodia.