Following the 2015 general election, in which Labour lost to the Conservative Party, Miliband resigned as leader. Burnham launched his campaign to succeed Miliband in the resulting September 2015 leadership election. He finished a distant second behind Jeremy Corbyn. Following the defeat, he accepted a role in Corbyn's Shadow Cabinet as Shadow Home Secretary. In May 2016 Burnham announced his candidacy to become Labour's candidate for the Greater Manchester Mayoralty and was selected in August 2016. He resigned as Shadow Home Secretary in October 2016 and was replaced by Diane Abbott. The mayoral election was held in May 2017 and the announcement of the June 2017 general election during the Mayoral campaign led him to stand down as an MP.