After the 2015 general election, Cameron formed a majority government. The government stayed in office until David Cameron resigned as Prime Minister on 13 July 2016 shortly after losing the EU referendum.