On 17 March 1991, an all-Russian referendum created the post of President of the RSFSR. On 12 June, Boris Yeltsin was elected President of Russia by popular vote. During an unsuccessful coup attempt on 19–21 August 1991 in Moscow, the capital of the Soviet Union and Russia, President of Russia Yeltsin strongly supported the President of the Soviet Union, Mikhail Gorbachev.