“@BBCScotlandNews understands Lord Keen, the advocate general, has found it increasingly difficult to reconcile govt plans to change EU exit deal with the law,” BBC reporter Glenn Campbell said on Twitter.
He added that the resignation had yet to be accepted.
Keen has served as advocate general, a political appointment, since 2015.
Other senior members of Johnson’s Conservative Party have also expressed opposition to the draft legislation unveiled last week, which the government acknowledges would violate international legal obligations and undercut parts of the divorce deal it signed before Britain formally left the European Union in January.
Brussels wants Johnson to scrap what is known as the Internal Market bill, saying it could sink talks on future trade arrangements before Britain leaves the EU’s single market, which it has remained part of during a status quo transition period that expires at the end of this year.
Johnson has refused.
The Internal Market Bill is aimed at ensuring Britain’s four constituent nations can trade freely with one another after leaving the EU, but the government says that requires overriding part of the withdrawal treaty it signed with Brussels.