The Scottish Secretary has said he remains confident a deal can be reached with the devolved governments over key Brexit legislation.
David Mundell said discussions would "go to the wire" as the EU Withdrawal Bill reaches its final stages in the House of Lords.
His comments came as the UK Government launched a legal challenge to alternative Brexit bills passed by the Scottish and Welsh devolved administrations.
He told BBC Radio Scotland's Good Morning Scotland programme: "I'm afraid the discussions and negotiations will go right up to the wire, but I am confident that we can reach an agreement."
READ MORE: UK government challenges devolved Brexit legislation
The Scottish and Welsh governments brought forward unprecedented legislation after a row with UK ministers over the return of devolved powers from Brussels once Britain leaves the EU.
Ministers in both Cardiff and Edinburgh have repeatedly branded the EU Withdrawal Bill a "power grab" which threatens devolution, and have refused to recommend legislative consent unless it is amended.
However bills passed in the Scottish Parliament and Welsh Assembly last month aimed at providing an alternative to the UK Government's legislation have now been referred to the Supreme Court.
The decision was taken by the Attorney General and the Advocate General for Scotland, the UK Government's senior law officers.
The court is being asked to rule on whether the legislation is constitutional and within the powers of the devolved legislatures.
READ MORE: UK government challenges devolved Brexit legislation
Mr Mundell said: "The court referral is about seeking clarity, seeking certainty when different views have been expressed."
He was unable to confirm the estimated cost of the legal challenge, adding: "We're only at the very start of the legal process.
"It costs £200 to refer the case to the court. Obviously if the case became involved in a protracted discussion there is greater cost."
He added: "It's very important that when you see two different views expressed about a piece of legislation, that actually somebody gives a definitive view, is it competent or is it not."
Why are you making commenting on The Herald only available to subscribers?
It should have been a safe space for informed debate, somewhere for readers to discuss issues around the biggest stories of the day, but all too often the below the line comments on most websites have become bogged down by off-topic discussions and abuse.
heraldscotland.com is tackling this problem by allowing only subscribers to comment.
We are doing this to improve the experience for our loyal readers and we believe it will reduce the ability of trolls and troublemakers, who occasionally find their way onto our site, to abuse our journalists and readers. We also hope it will help the comments section fulfil its promise as a part of Scotland's conversation with itself.
We are lucky at The Herald. We are read by an informed, educated readership who can add their knowledge and insights to our stories.
That is invaluable.
We are making the subscriber-only change to support our valued readers, who tell us they don't want the site cluttered up with irrelevant comments, untruths and abuse.
In the past, the journalist’s job was to collect and distribute information to the audience. Technology means that readers can shape a discussion. We look forward to hearing from you on heraldscotland.com
Comments & Moderation
Readers’ comments: You are personally liable for the content of any comments you upload to this website, so please act responsibly. We do not pre-moderate or monitor readers’ comments appearing on our websites, but we do post-moderate in response to complaints we receive or otherwise when a potential problem comes to our attention. You can make a complaint by using the ‘report this post’ link . We may then apply our discretion under the user terms to amend or delete comments.
Post moderation is undertaken full-time 9am-6pm on weekdays, and on a part-time basis outwith those hours.
Read the rules hereComments are closed on this article