Nicola Sturgeon has been formally sworn in as First Minister after securing her first personal mandate from the public to lead a re-elected SNP government at Holyrood.

READ MORE: Nicola Sturgeon drawn into SNP love triangle

Ms Sturgeon's party won the largest share of seats in the Scottish Parliament election on May 5 but with a reduced representation, leaving her with a minority administration.

READ MORE: Alex Neil resigns as social justice secretary

READ MORE: Richard Lochhead to step down from Scottish Cabinet

She took over from Alex Salmond, Scotland's longest-serving first minister, following the SNP's failed bid to secure Scottish independence in 2014.

Despite her reduced numbers, she won the Scottish election convincingly with twice as many seats as the resurgent Scottish Conservatives, who replaced Labour as Holyrood's second biggest party.

Ms Sturgeon was sworn in before 15 judges in courtroom one of the First Division of the Court of Session in Edinburgh with Lord Carloway, Scotland's Lord President, in the chair.

She handed the principal clerk the warrant appointing her First Minister.

The Lord President acknowledged the warrant, under Her Majesty's Sign Manual, presenting the SNP leader in her full name Nicola Ferguson Sturgeon.

Ms Sturgeon then acknowledged the official declaration: "You do solemnly, sincerely and truly declare and affirm that you will well and truly serve Her Majesty, Queen Elizabeth, in the office of First Minister of the Scottish Government."

She made the vow again as the Keeper of the Seal, and once more as a declaration of allegiance.

Ms Sturgeon then signed the parchments and took her seat in a chair provided for her within the bar. Lord Carloway then said a few words of welcome to the court.