On 24 April 1990, Nazarbayev was elected as the first President of Kazakhstan by the Supreme Soviet. He supported Russian President Boris Yeltsin against the attempted coup in August 1991 by Soviet hardliners. Nazarbayev was close enough to Soviet leader Mikhail Gorbachev for Gorbachev to consider him for the post of Vice President of the Soviet Union; however, Nazarbayev turned the offer down. However, on 29 July, Gorbachev, Yeltsin, and Nazarbayev discussed and decided that once the New Union Treaty was signed, Nazarbayev would replace Valentin Pavlov as Premier of the Soviet Union.