The European Union flag is to be taken down outside the Scottish Parliament when the UK leaves on 31 January, it has been confirmed.
Former Europe minister Alasdair Allan was campaigning for the flag to stay up to mark Scotland's 62% vote for Remain.
But the parliament's management group has confirmed that it will come down.
Presiding Officer Ken Macintosh told MSPs that the Council of Europe Flag will be flown on Europe Day "as a mark of our continued ties with that body".
The flag will be lowered at 23:00 on 31 January, at the moment the UK officially leaves the EU.
Mr Allan had submitted a parliamentary motion saying that parliament "should continue to fly the EU flag on its grounds, in line with the democratic decisions of Scotland's voters and MSPs to remain in the EU".
This was backed by a number of his SNP colleagues and some Greens, but has now been dismissed by the parliament's cross-party corporate body management group.
Mike Russell, the Scottish government's Brexit secretary, later tweeted that the decision was "wrong and needs to be changed". It is understood the government could attempt to overturn the decision.
I entirely agree. The wrong decision which needs to be changed. The flag is not only a symbol of our solidarity with the #27 and all EU citizens in Scotland it also represents our wish as a nation to return to membership of a union we never voted to leave. https://t.co/Py6O6ijRLm— Michael Russell (@Feorlean) January 16, 2020
An email from Mr Macintosh to all MSPs said the group had agreed that "from 11pm on 31 January the Scottish Parliament will no longer fly the EU flag on a daily basis".
He added: "The corporate body decided that on Europe Day we shall fly the Council of Europe flag as a mark of our continued ties with that body and that our flag-flying policy should be amended to reflect these decisions."
After Mr Allan asked in a point of order if the move could be challenged by MSPs, Mr Macintosh insisted it was a "non political decision".
He said: "The corporate body discussed this at length and was very aware of the political sensitivities or the feelings of members of this chamber and of Scotland generally.
"There is a huge amount of symbolism and politics in flag-waving and flag flying. The corporate body takes decisions in the interest of the parliament, not in the interest of any party.
"It is a neutral and trusted institution, and the members of the corporate body were very aware of the need to do so, and not to take a political decision on this matter."