Jack McConnell's term as first minister of Scotland began on 22 November 2001 when he was formally sworn into office at the Court of Session. It followed the resignation of Henry McLeish over the Officegate scandal. His term ended on 16 May 2007, following the defeat of the Scottish Labour Party in the 2007 Scottish Parliament election, where the Scottish National Party formed a minority government. McConnell entered office amid the aftermath of the Scottish Parliament's first political scandal and suffered fierce opposition.