There was a Scottish National Party leadership election in 2004, following the resignation of John Swinney as National Convener of the Scottish National Party (SNP). The election saw the return of Alex Salmond to the party fore, and a deal between Salmond and Nicola Sturgeon saw Sturgeon drop out of the leadership race and instead run for the Depute leadership on a joint campaign with Salmond. Both Salmond and Sturgeon won their respective positions in the first round.
Elected in 2000, Swinney had presided over a contested leadership, marred by electoral failure, with the party losing both seats and votes in the 2003 parliamentary and local elections. Following a disappointing European election result, which saw the party dropping to less than 20% of the vote, senior figures within the SNP began privately briefing against Swinney. Gil Paterson, a former MSP for Central Scotland was the first to call for Swinney's departure, with Michael Russell, a former potential campaign manager for Swinney calling for a change in approach from the SNP. Members of the SNP shadow cabinet began privately discussing removing Swinney from the leadership, and Alex Salmond advised Swinney to resign in exchange for senior party figures not calling openly for his resignation. Swinney resigned on 22 June 2004.
The fight over who was to succeed Swinney saw the re-emergence of former leader Alex Salmond, who entered the race despite having repeatedly denied any ambitions to run. Most famously, Salmond quipped in June 2004 that "If nominated I'll decline. If drafted I'll defer. And if elected I'll resign." Salmond launched his campaign less than a month later, on 15 July.
After Salmond announced his campaign for the leadership, Nicola Sturgeon dropped her bid, and ran instead for the Deputy Leadership. The two ran on a joint campaign. Kenny MacAskill dropped his bid for Deputy, and gave his support to Sturgeon.
Alex Neil, a member of the SNP fundamentalist grouping who ran against Swinney for the leadership in 2000 considered running again for party leader, although later pulled out of the race. Neil blamed Alex Salmond for "vetoing" his candidacy, and claimed that both Salmond and Ewing had stated they would refuse to work with him were he to have been elected. Neil claimed that this treatment was in line with the treatment of him and his supporters since the 2000 leadership election. Neil's campaign was also undermined by two further issues; the impression amongst the party leadership that Neil allies, such as Campbell Martin, had constantly undermined Swinney's leadership, and the fact that Neil supporters had been fundamentalist SNP party members not to renew their party membership. Rules around the holding of the new leadership election meant that any members who had not renewed their membership found it difficult to register in time.
Ultimately the Salmond–Sturgeon campaign was successful, and both candidates won in the first round.
The election was the first SNP election to use the one-person-one-vote postal voting system.