Law Officers of the Crown
The Law Officers of the Crown are the chief legal advisers to the Crown, and advise and represent the various governments in the United Kingdom and the other Commonwealth Realms. In England and Wales, Northern Ireland and most Commonwealth and colonial governments, the chief law officer of the Crown is the Attorney General. In Scotland, the chief law officer is the Lord Advocate, and following devolution of justice to the Scottish Parliament a new position of Advocate General for Scotland was created to advise the UK Government on matters of Scots law.
England and Wales
The Attorney General for England and Wales is the chief legal adviser of the Crown in England and Wales, and a member of the Government. The Attorney General provides legal advice to the Government of the day. By convention, and unlike the papers of other ministers, this legal advice is available to subsequent governments.
The Attorney General oversees the small Attorney General's Office and also has responsibility for the Treasury Solicitor's Department. The Treasury Solicitor acts on behalf of the Attorney General when representation in court is required.
The Attorney General also has supervisory powers over prosecutions, including those mounted by the Crown Prosecution Service, headed by the Director of Public Prosecutions); the Serious Fraud Office; and the Revenue and Customs Prosecutions Office.
The Attorney General has public interest functions, being, for example, the trustee of default where a sole trustee has died, and can also take cases to the Supreme Court where points of general legal importance need to be settled.
The Attorney General is assisted by the Solicitor General for England and Wales, currently Edward Garnier MP QC. Under the Law Officers Act 1997, the Solicitor General may do anything on behalf of, or in the place of, the Attorney General, and vice versa.
The chief legal adviser in Scotland is the Lord Advocate, currently Frank Mulholland. The Lord Advocate heads the Crown Office and Procurator Fiscal Service, and is the chief public prosecutor in Scotland.
Under constitutional reforms, the Lord Advocate has become a member of the Scottish Government, while the United Kingdom Government is advised on Scots law by the holder of the newly created post of Advocate General for Scotland.
In 1972 the functions of the former Attorney General for Northern Ireland were conferred on the Attorney General for England and Wales as part of direct rule. When policing and justice were devolved to the Northern Ireland Assembly on 12 April 2010, these functions were split between:-
The Advocate General for Northern Ireland, who is the chief legal adviser to the UK Government on Northern Ireland law.  The post is held by the Attorney General for England and Wales by virtue of office.
The Attorney General for Northern Ireland, who is the chief legal adviser to the Northern Ireland Executive. John Larkin QC was appointed to that position on 24 May 2010 by the First Minister of Northern Ireland and deputy First Minister of Northern Ireland. 
Most Commonwealth and colonial governments also have their own Attorneys General. Sometimes the legal advisers of subnational governments are given the title Advocate General.
Some subjects are entitled to have an attorney general: these include a Queen consort and the Prince of Wales, who has an Attorney General for the Duchy of Cornwall. There is also an Attorney General for the Duchy of Lancaster, which is a mostly landed inheritance that is held in trust for the monarch and administered independently of the monarch under the supervision of a Government minister, the Chancellor of the Duchy of Lancaster.
Before the establishment of the Irish Free State in 1922, the legal advisers to the Crown in the Courts of Ireland were the Attorney-General for Ireland and the Solicitor-General for Ireland. These offices became redundant in 1921.
The Crown also had a legal adviser for the High Court of Admiralty, known as the Admiralty Advocate, but this office lapsed in 1875 when the Admiralty Court became part of the Probate, Divorce and Admiralty Division of the High Court of Justice.
The Crown's representative in the ecclesiastical courts of England was the King's Advocate (or Queen's Advocate when the monarch was female). This office has been vacant since the resignation of its last holder in 1872.
- Attorney General's Office: Statement on Northern Ireland devolution, 12 April 2010
- section 22, Justice (Northern Ireland) Act 2002 (c.26)
- OFMDFM: Appointment of Attorney General announced, 24 May 2010
- Haydn's Book of Dignities, 1894