MSPs are to be given a vote on whether to keep the European flag flying at Holyrood after the UK leaves the EU.
The parliament's corporate body management group had decided to take the flag down at the moment of Brexit.
But the Scottish government has pushed for a vote in the chamber, citing the 62% Remain vote north of the border.
Presiding Officer Ken Macintosh urged ministers not to politicise the issue, saying the flags flown at Holyrood "reflect our relationships in law".
But a government spokesman said "symbolism matters" and that it is "reasonable to put it to a vote".
The Scottish Parliamentary Corporate Body (SPCB) - a management group comprising members of each of Holyrood's parties - had previously decided that the flag should be lowered at 23:00 on 31 January, the moment the UK officially leaves the EU.
The Scottish government protested, with Brexit Secretary Mike Russell saying the move was "wrong and needs to be changed".
A 30-minute debate is now to be held on Wednesday, with MSPs voting later in the day on a government motion which "directs" the SPCB to keep the flag flying "daily".
The motion states that Scotland and the UK will continue to be represented in the Council of Europe, and that the flag should stay up "as a sign of support and solidarity with those EU nationals who have made Scotland their home".
Mr Macintosh wrote to the government stressing that the decision "was not a political one", and saying there was a "clear desire from all members of the SPCB that our flag flying policy should not become a political issue for debate on the floor of the chamber".
There was controversy even as MSPs agreed to hold the vote, with opposition members objecting that "parliamentary time is scarce".
Scottish Lib Dem leader Willie Rennie said that even as a passionate pro-European, he believed parliament should "respect the decision of the corporate body and the independence of the corporate body".
Scottish government business manager Graeme Dey said ministers had only sought a debate "with a heavy heart" after the SPCB had refused to revisit their position, and said the debate was always going to become political.