Scottish lawmakers on Wednesday voted to keep the European Union flag flying outside the devolved parliament in Edinburgh after Brexit.
The group that manages parliament had planned to lower the flag at 11.00 pm (2300 GMT) on Friday, when Britain officially leaves the EU.But members of the Scottish Parliament (MSPs) voted by 63 to 54 to overturn the decision after heated debate.
Presiding Officer Ken Macintosh had warned ministers that flags "should not become a political issue" and that they "reflect our relationships in law".
Scotland voted by 62 percent to 38 percent to remain in the EU during the 2016 referendum but Britain as a whole voted out, and will leave on Friday.
First Minister Nicola Sturgeon, who leads the pro-EU Scottish National Party, had urged for the EU flag to keep flying, angering opposition parties.
The Conservatives, Labour and the Liberal Democrats insisted that the "non-political" ruling of the Parliamentary Corporate Body should have stood.
The motion passed by MSPs said that the flag should stay up "as a sign of support and solidarity with those EU nationals who have made Scotland their home".Separately, and as expected, MSPs endorsed Sturgeon's calls by 64 votes to 54 for a second referendum on Scottish independence, after a previous vote in 2014 saw the proposal rejected.
Sturgeon and the SNP argue that Brexit has changed the "material circumstances" of Scotland's relationship with the rest of the UK, because of its majority vote to remain in the EU.
Her motion calls on the UK government in London to "reach an agreement with the Scottish Government on such a referendum taking place on a date and in a manner determined by the Scottish Parliament".
UK Prime Minister Boris Johnson has consistently ruled out holding another referendum.