MSPs have voted to keep the European flag flying at Holyrood after Brexit – overturning a decision made by the parliamentary corporate body.

After a bad-tempered debate on Wednesday, SNP and Scottish Green MSPs backed a motion not to remove the flag at 11pm on Friday when the UK leaves the EU.

Members voted by 63 to 54, with one abstention, in favour of the motion.

An amendment put forward by Tory MSP Liz Smith fell by 63 votes to 54 with one abstention, as did an amendment from Labour's Claire Baker.

The vote was called this week in response to a decision by the Scottish Parliamentary Corporate Body (SPCB) to remove the flag after Brexit.

READ MORE: MEPs ‘leave a light on’ for Scotland's return to the EU

However, some members opposed holding the vote in the first place as they complained it was a waste of parliamentary time.

But Culture Secretary Fiona Hyslop said: "We need to give practical demonstration to the sense of loss that so many in this chamber and beyond will feel when we are no longer members of the European Union."

She said the vote gave the Scottish Parliament a choice on the issue, adding the SPCB's decision to remove the flag "does not reflect the views of Parliament as a whole".

During her speech, Hyslop repeatedly rejected an intervention from Labour MSP Neil Findlay, which he could be heard describing as "a disgrace".

Findlay raised a point of order with Deputy Presiding Officer Linda Fabiani, complaining backbenchers were not due to speak in the debate and so should be allowed to interject.

Fabiani stepped in to chide MSPs for being "rude" in the chamber.

READ MORE: Brexit day: Events for pro-indy Remainers across Scotland

Smith said the passing of the motion would set a dangerous precedent of the Government overruling the SPCB - which is supposed to remain neutral.

She said: "It is vital that there is full trust and confidence in the work of the corporate body to act in an impartial manner on behalf of all members, rather than on behalf of the political parties of the Parliament.

"The issue before this Parliament today is not what we think about the withdrawal of the UK from the EU, it's about whether members of this Parliament are prepared to undermine the corporate body.

"Are we well aware of the dangers that could provide?"

Later in the debate, tempers flared between Scottish Green MSP Ross Greer, Tory justice spokesman Liam Kerr and Liberal Democrat MSP Liam McArthur.

After announcing his support for the motion, Greer took an intervention from Kerr in which the Tory claimed his request for a ministerial statement on the state of the police estate in Scotland had been refused due to "lack of time".

READ MORE: SNP anger over £46m Get Ready For Brexit ads after NAO findings

Kerr asked the Green MSP if he feels "any shame or embarrassment" for supporting such a debate going ahead.

Greer responded: "I'm sure Mr Kerr enjoyed that moment of self-indulgence but I'm going to come to the point of the hypocrisy of the Tories in a moment."

The Green MSP also chastised the Liberal Democrats, who had indicated before McArthur spoke that they would not support the Government motion.

He said: "The only real losers here are the Liberal Democrats - the party of Europe - who, unless they're about to make some significant U-turn, are set to vote with the Conservatives to take the flag down."

In response, McArthur said: "It's a matter of deep regret to me that this Parliament is having this debate on this Government motion and has just been subjected to that contribution from Ross Greer."