The office of Advocate General for Scotland was created in 1999 by the Scotland Act 1998 to be the chief legal adviser to the United Kingdom Government on Scots law. This function had previously been carried out by the Lord Advocate and Solicitor General for Scotland, who were transferred to the Scottish Government on the establishment of the Scottish Parliament. The office of the Advocate General for Scotland should not be confused with that of "His Majesty's Advocate", which is the term used for the Lord Advocate in Scottish criminal proceedings.
The office was then vacant until 15 March of that year when, under section 87 of the Scotland Act 1998, its functions were temporarily conferred on the Secretary of State for Scotland, Alastair Darling MP, himself a Scottish advocate.[citation needed]
There had been substantial criticism from the judiciary and others of the length of time the office had been left vacant.[citation needed] On 21 March, however, it was announced Neil Davidson, former Solicitor General for Scotland, had been appointed Advocate General. He was created a life peer, as Baron Davidson of Glen Clova, on 22 March 2006.
Richard Keen was appointed Advocate General in David Cameron's majority government on 29 May 2015, and has retained the post through two subsequent prime ministers to 2020.[9] He was created a life peer, as Baron Keen of Elie, on 8 June 2015. He resigned on 16 September 2020 citing concerns arising from the UK Internal Market Bill, noting in his letter of resignation to Boris Johnson that he found it "increasingly difficult to reconcile what I consider to be my obligations as a Law Officer with your policy intentions".[10]
Keith Stewart was appointed to succeed Keen on 15 October 2020.[11]