UPDATE 3-Top Scottish law officer resigns from UK PM Johnson's government

(Recasts with confirmation of resignation)

LONDON, Sept 16 (Reuters) - Scotland’s top law adviser to the British government, Richard Keen, has resigned in an apparent dispute over Prime Minister Boris Johnson’s plan to break international law by breaching parts of the Brexit divorce treaty.

Keen had found it increasingly difficult to reconcile govt plans to change EU exit deal with the law, the BBC reported.

“Lord Keen has resigned as Advocate General for Scotland. The Prime Minister thanks him for his service,” Johnson’s Downing Street office said in a statement.

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 announced 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.

Johnson’s government has reached a deal to avert a rebellion in parliament over the plan, the BBC reported, but Keen’s resignation was confirmed after that report neverthless.

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. (Reporting by Andy Bruce and William James; writing by Alistair Smout; editing by Guy Faulconbridge)