Founded in 1934 with the amalgamation of the National Party of Scotland and the Scottish Party, the party has had continuous parliamentary representation in Westminster since Winnie Ewing won the 1967 Hamilton by-election. With the establishment of the devolved Scottish Parliament in 1999, the SNP became the second-largest party, serving two terms as the opposition. The SNP gained power under Alex Salmond at the 2007 Scottish Parliament election, forming a minority government, before going on to win the 2011 Parliament election, after which it formed Holyrood's first majority government. After Scotland voted against independence in the 2014 referendum, Salmond resigned and was succeeded by Sturgeon. The SNP was reduced back to being a minority government at the 2016 election.