From 1707 to 1998, the Lord Advocate was the chief legal adviser of the British Government and the Crown on Scottish legal matters, both civil and criminal, until the Scotland Act 1998 devolved most domestic affairs to the Scottish Parliament.