Soon after the fall of Saigon, the Socialist Republic of Vietnam was established. In the new government, Giáp maintained his position as Minister of National Defense and he was made Deputy Prime Minister in July 1976. In December 1978 he oversaw the successful Cambodian–Vietnamese War which drove the Khmer Rouge from power and ended the Cambodian genocide. In retaliation, Cambodia's ally China responded by invading the Cao Bang province of Vietnam in January 1979 and once again Giáp was in overall responsibility for the response, which drove the Chinese out after a few months. He finally retired from his post at the Defense Ministry in 1981 and retired from the Politburo in 1982. He remained on the Central Committee and Deputy Prime Minister until he retired in 1991.