He was Chief Minister of Uttar Pradesh (1976–77, 1984–85, 1988–89) and Chief Minister of Uttarakhand (2002–2007). In 1986–1987, he was in Prime Minister Rajiv Gandhi's cabinet as Minister for External Affairs. He was Governor of Andhra Pradesh from 2007 until 2009.