In a referendum on 17 March 1991, majorities in nine of the 15 republics voted to preserve the Union. The referendum gave Soviet leader Mikhail Gorbachev a minor boost, and in the summer of 1991, the New Union Treaty was designed and agreed upon by eight republics. The treaty would have turned the Soviet Union into a much looser federation, but its signing was interrupted by the August Coup—an attempted coup d'état against Gorbachev by hardline Communist Party members of the government and the KGB, who sought to reverse Gorbachev's reforms and reassert the central government's control over the republics. When the coup collapsed, Yeltsin—who had publicly opposed it—came out as a hero, while Gorbachev's power was effectively ended.