Legal action "cannot be ruled out" if the UK government blocks a section 30 order which would allow Scotland to hold an independence referendum, the country's Brexit minister said.
Constitutional Relations Secretary Mike Russell said that although he would be "reluctant" to use public money in court, he suggested that a legal route could still be open in the event that a request for another vote is denied.
However, Mr Russell also said that legal action would not be required if people in Scotland demand that a section 30 order is granted.
Speaking at a fringe event at the SNP conference in Aberdeen hosted by the Law Society of Scotland, Mr Russell was asked: "Assuming that we hit a Westminster stonewall on independence ... do you see a circumstance where the courts in some way could step in and make some kind of a decision for or against Scotland's independence?"
He responded: "I'm reluctant to see Scottish money being spent in courts on these matters.
"David Allen Green, the legal commentator, says that constitutional law is meant to be dull and when it gets exciting, that's dangerous. I think probably he's right.
"But now we're beginning to see the developments of certain things taking place so I don't know is the answer. I think it cannot be ruled out."
Mr Russell added: "I think we've moved into a different time, there are different currents flowing here. I don't know.
"But the best way to get this is to make sure the people of Scotland don't ask for a Section 30 order, they demand a section 30 order, and it is clear that Scotland wants to go in that direction.
"You do that and there will be absolutely no need for legal action."
Mr Russell also dismissed suggestions that Scotland would not seek to rejoin the EU if an independence vote was achieved.
"Let me make it absolutely clear - the position of the Scottish government is to seek independent membership of the EU," said Mr Russell.
"That is the position, that is what we seek to do and that is what we are going to do."