Judges at the Supreme Court have rejected the Scottish government's argument that Holyrood should get a say on the triggering of Article 50.
The court decided that MPs must have a say on starting the formal process of Brexit via an act of parliament.
However, they also rejected arguments from the Lord Advocate that devolved administrations should also have a say.
First Minister Nicola Sturgeon has pledged to hold a Holyrood vote on the matter regardless of the ruling.
She said there remained a "clear political obligation" on the UK government to consult devolved administrations, adding that "it is becoming clearer by the day that Scotland's voice is simply not being heard or listened to within the UK".
Ministers wanted to invoke Article 50 of the Lisbon Treaty, the formal process for leaving the European Union, without consulting the Westminster parliament.
Campaigners disputed this, saying the referendum result alone does not give ministers the power to change the British constitution and supersede legislation.
The Supreme Court justices backed the challenge by eight votes to three, with President Lord Neuberger summarising their ruling as: "The Government cannot trigger Article 50 without an Act of Parliament authorising it to do so."
With Jeremy Corbyn pledging the support of Labour MPs to backing the government on Article 50, the defeat in court is not expected to derail the Brexit process, although it could pose complications.
The SNP have vowed to vote against invoking Article 50 if it does go to a vote at Westminster, while the Lib Dems have said they will oppose it unless there is a referendum on the final Brexit deal.
Analysis by BBC Scotland Political Editor Brian Taylor
Today's Supreme Court ruling delineates precisely where formal, statutory power lies on the issue of reshaping Britain's relationship with the EU.
Europe, as an issue, is reserved to Westminster along with foreign affairs more generally.
It falls to the UK Parliament to implement the expressed popular will of the UK as a whole.
Quite right, say supporters of the Union, advising Nicola Sturgeon to fall into step. Which brings us back to the fundamental issue in Scottish politics.
Ms Sturgeon does not accept a UK mandate but rather seeks the power to implement an independent Scottish mandate.
Two competing options, then. It seems now very likely - perhaps indeed "all but inevitable" - that the people of Scotland will be asked, once more, which constitutional arrangement they favour.
Read more from Brian here.
Meanwhile, the Scottish government was also represented in the Supreme Court case, with Lord Advocate James Wolffe arguing Holyrood's consent should also be sought due to the "significant changes" Brexit would have on devolved powers.
Lawyers for the UK government rejected this, saying the argument was "fatally undermined" by the fact that powers over foreign affairs are reserved to Westminster.
The judges unanimously rejected Mr Wolffe's arguments, saying that the principle of legislative consent "does not give rise to a legally enforceable obligation".
They said the Sewel Convention, which provides that Holyrood should be consulted where Westminster legislation cuts across devolved areas, plays "an important role in the operation of the UK constitution", but is not a matter for the courts.
They added: "The devolved legislatures do not have a veto on the UK's decision to withdraw from the EU."
The SNP welcomed the ruling in relation to the Westminster vote, with the party's international affairs spokesman Alex Salmond pledging to introduce 50 amendments to the Article 50 legislation as it passes through parliament.
Later in the day, Ms Sturgeon will convene a meeting of her Standing Council on Europe, a team of legal, economic and diplomatic advisors.
Also in attendance will be External Affairs Secretary Fiona Hyslop, Brexit minister Mike Russell and Europe minister Alasdair Allan.
The first minister, who has said a second Scottish independence referendum is "undoubtedly" closer due to Theresa May's Brexit plans, declared her intention to hold a Holyrood vote on Article 50 regardless of the ruling of the court.
She said: "We are obviously disappointed with the Supreme Court's ruling in respect of the devolved administrations and the legal enforceability of the Sewel Convention.
"It is now crystal clear that the promises made to Scotland by the UK government about the Sewel Convention and the importance of embedding it in statute were not worth the paper they were written on.
"Although the court has concluded that the UK government is not legally obliged to consult the devolved administrations, there remains a clear political obligation to do so.
"The Scottish government will bring forward a Legislative Consent Motion and ensure that the Scottish Parliament has the opportunity to vote on whether or not it consents to the triggering of Article 50."
Ms Sturgeon also said the ruling raises "fundamental issues above and beyond that of EU membership", saying it was "becoming ever clearer" that Scots face a fresh choice over independence.
The Scottish Conservatives called on the SNP to stop trying to "hold the UK to ransom" over Brexit.
Leader Ruth Davidson said: "Whatever side people were on last year, Scotland wants to get on with the negotiations so we can start to leave the uncertainty of the last few years behind us.
"We have all had enough of the nationalists using every diversionary tactic they can to try to use Brexit to manufacture a case for separation.
"The SNP needs to decide: does it want Britain's renegotiation to succeed or fail? If it is the former, it needs to end the attempts to sow division and add to the uncertainty we face, and instead get behind the UK attempt to get the right deal for the whole UK."
Scottish Labour leader Kezia Dugdale said her party would "continue to work with the Scottish government to get the best deal for Scotland within the UK".
She added: "Both the SNP and the Conservatives are casting about for an expedient political position rather than working in the national interest. Unity cannot be achieved by a politics that sees one half of the country constantly facing off against the other.
"We are divided enough already. That's why there will be no support from Scottish Labour for any SNP plan for a second independence referendum."
Scottish Green co-convener Patrick Harvie said the ruling showed Scotland is "not an equal partner in the UK", saying it was "hard to see any other option" than a second independence referendum.
And Scottish Lib Dem leader Willie Rennie said the case presented "a huge opportunity" for a referendum on the final Brexit deal.