The UK government’s law officer for Scotland, Lord Keen, has offered his resignation to the prime minister.
BBC Scotland understands the advocate general has found it difficult to reconcile plans to override the Brexit withdrawal agreement with the law.
Lord Keen’s resignation has not yet been accepted by Downing Street.
BBC Scotland chief political correspondent Glenn Campbell said there appeared to be an effort to persuade the law officer to remain in the post.
It comes amid an ongoing row over the UK government’s Internal Markets Bill, which Northern Ireland Secretary Brandon Lewis told MPs could “break international law” by overriding the withdrawal agreement signed with the EU.
However, Lord Keen subsequently said in the House of Lords that his view was that “the bill does not of itself constitute a breach of international law or of the rule of law”.
He argued at the time that Mr Lewis had “essentially answered the wrong question”.
But the Northern Ireland secretary has hit back, saying that his statement was a “very straight answer” which was “absolutely in line” with legal advice.
BBC Political Editor Laura Kuenssberg said Lord Keen’s resignation had been rumoured for days, and had ultimately happened “after Brandon Lewis contradicted him this morning”.
Lord Keen had been the chairman of the Scottish Conservatives until being appointed as Advocate General in 2015.