Dorothy Bain KC, the Lord Advocate and the Scottish Government’s top law officer, said it was “in the public interest” for the matter to be decided by the UK’s highest court.
She said the advisory referendum planned by the Scottish Government would have “no prescribed legal consequences” and would simply seek to ascertain the views of the people of Scotland.
Ms Bain said the political fallout and motivations of SNP ministers were legally irrelevant.
Sir James Eadie KC, representing the Advocate General for Scotland for the UK Government, said the court should dismiss the case because the Scottish Parliament has yet to pass legislation for a second referendum.
He said it is “not appropriate for courts generally to engage with abstract questions of law until the facts are known”.
It came as justices heard submissions on the first day of a landmark legal battle over a second independence referendum.
Supreme Court president Lord Reed stressed that despite the “political context”, the court was limited to “technical questions of law”.
He said the court “will require time after the hearing to prepare its judgement”, and added: “The hearing is the tip of the iceberg.
"We also have more than 8,000 pages of written material to consider. Therefore, as is usual, it's likely to be some months before we give our judgement.”
Two days have been set aside for the hearing at the Supreme Court in London.
Judges have been asked to decide whether referendum legislation proposed by the Scottish Government relates to “reserved matters”, meaning it is outwith Holyrood’s competence.
First Minister Nicola Sturgeon wants to hold a referendum in October next year, but the UK Government has refused to agree to this. This means a repeat of the 2014 vote, which was agreed between the two governments, is not possible.
Much of the legal arguments centre on differing interpretations of the Scotland Act 1998, which says matters relating to the Union are reserved to Westminster.
Ms Bain said there is a “genuine issue” that is unresolved, adding: “The issue is one of exceptional importance to the people of Scotland and the UK.”
She said that without a ruling from the court she could not “clear” the Bill as she does not have the "necessary degree of confidence" that it is within Holyrood’s power.
The Lord Advocate said there is “a risk” that a Bill could be introduced by an individual member of the Scottish Parliament, which reinforces “the importance of obtaining an authoritative judicial ruling from this court at this stage”.
She said she is seeking “legal certainty”.
Ms Bain said Lord Mackay of Drumadoon, a former Scottish appeal judge and Lord Advocate, had predicted the matter would become a “festering issue” ahead of the creation of the Scottish Parliament.
She added: “In our submission, he has been proved right. It is an issue that I invite this court to finally resolve.”
Elsewhere, she said holding a referendum is not a reserved matter.
The Lord Advocate said the referendum would not be “self-executing” and so no legal consequences would necessarily result from it.
She told the court: “That was the case in the Scottish Independence Referendum Act 2013, which provided for a referendum on independence.
“It was a position adopted by the Westminster Parliament in the European Union Referendum Act 2015. And it is the position in respect of the draft Bill.
“A non self-executing referendum invariably has political consequences, but in law, it has no effect. They are entirely advisory.”
She said the Bill seeks to “ascertain the wishes of the people of Scotland on their own future” and the wider motivation of the Scottish Government is not “legally relevant”.
She added: “This court is deciding a question of law, in respect of which we do not take account of the political effect of any vote that would arise from Scotland in relation to an advisory referendum.”
Ms Bain said the legislation “would not purport to alter or impede any legal rule constituting or affecting the Union of the kingdoms of Scotland and England, either directly or indirectly”.
She added: "The holding of a purely advisory referendum does not take the question of the Union out of the hands of the UK Parliament, nor does it purport to do so.”
Concluding her submission, she said: “Since 2007, at four successive Scottish parliamentary elections, the Scottish electorate has returned governments committed to Scottish independence.
“Separately, at each UK general election since 2015, a majority of MPs from Scottish constituencies have been elected on the same manifesto commitment.
“Against that background and long-standing consensus that Scotland has the right to self-determination, to what extent, if at all, the holding of a referendum relates to a ‘reserved matter’ is a question of fundamental constitutional and public importance.
"Despite the highly charged political debate, it is a question of law.
"It is therefore a question that can only be authoritatively determined by this court.”
Speaking in the closing half-hour of the first day, Sir James suggested the legislation should not be continued if the Scottish Government’s own law officer was not persuaded of its competence.
He said: “If you can’t even persuade your own law officer that you are within competence the shutters come down within the scheme of this legislation.”
He told the court that the Scotland Act sets out a “carefully regulated and specific timetable and set of requirements before a reference can be made of a Bill” to the Supreme Court.
Sir James claimed the Lord Advocate was seeking “a judicial ruling in the abstract” and that justices giving opinions on “hypothetical” issues “draws courts into policy making”.
His submission will continue on Wednesday.
Former first minister Alex Salmond said the Scottish Government was wrong to go to the Supreme Court and was “risking a great deal to gain comparatively little”.