THE Queen yesterday urged the nation to 'keep calm and carry on' in the wake of the Brexit vote - as Nicola Sturgeon affirmed Scotland's place within the European Union.

Speaking after the most febrile political week of her 64-year reign, which has put Scotland on the path to a second independence referendum, the monarch said it was important to stay “calm and collected” when events were moving at “remarkable speed”.

READ MORE: Nicola Sturgeon seeks guarantees on rights of EU nationals in Scotland

Opening the fifth session of the Scottish Parliament since devolution, she told MSPs: “One hallmark of leadership in such a fast-moving world is allowing sufficient room for quiet thinking and contemplation, which can in turn enable deeper, cooler consideration of how challenges and opportunities can be best addressed.”

Although she did not mention Brexit directly, her message was not hard to decipher given the turmoil since June 23.

Speaking after the Queen, the First Minister, who has said a second referendum is “highly likely” if Scotland is pulled out the EU against its wishes, underlined her commitment to maintaining Scotland’s European ties, something that may only be possible with independence. Let us “play our part in a stronger Europe and a better world,” she said.

READ MORE: Nicola Sturgeon seeks guarantees on rights of EU nationals in Scotland

Sturgeon said MSPs had been given the "precious opportunity to contribute to building a better country - and build it we will", adding: "To do so we must be bold and ambitious. We must show courage and determination. Our collective commitment to the people of Scotland today is that we will not shy away from any challenge we face, no matter how difficult or deep-rooted."

Sturgeon also took a swipe at the Leave campaign’s xenophobia saying Scotland would remain an “open and inclusive nation” and thanking the thousands of EU migrants who had made their home here.

Reflecting on “who we are in Scotland today,” Sturgeon said: “We treat others with respect. We celebrate our differences...We are more than five million men and women, adults, young people and children, each with our own life story and family history, and our own hopes and dreams.

READ MORE: Nicola Sturgeon seeks guarantees on rights of EU nationals in Scotland

“We are the grandchildren and the great grandchildren of the thousands who came from Ireland to work in our shipyards and in our factories. We are the 80,000 Polish people, the 8,000 Lithuanians, the 7,000 each from France, Spain, Germany, Italy and Latvia. We are among the many from countries beyond our shores that we are so privileged to have living here amongst us.

“We are the more than half a million people born in England, Wales and Northern Ireland who have chosen to live here in Scotland. We are the thousands of European students studying at our universities and our colleges. We are the doctors and nurses from all across our continent and beyond who care for us daily in our National Health Service.

“Whether we have lived here for generations or are new Scots, from Europe, India, Pakistan, Africa and countries across the globe we are all of this and more. We are so much stronger for the diversity that shapes us. We are one Scotland and we are simply home to all of those who have chosen to live here. That is who and what we are.”

With a Rainbow flag flying outside Holyrood and a Pride march down the Royal Mile later in the day, the First Minister also referred to the recent attack on a gay nightclub in Florida.

She said: “A few weeks ago, all of Scotland – including leaders from across this Chamber – stood in solidarity with the victims of the Orlando massacre. And, today, we fly the Rainbow flag outside our Parliament. We do so with poignancy, but also with great pride - it is yet another vivid illustration and powerful symbol of the open and inclusive nation we are. The open and inclusive nation we are determined to remain.”

The same point was made in his opening remarks by Presiding Officer Ken Macintosh. “The last few weeks have borne witness to the politics of hate,” he warned. “Today outside this Parliament we fly the rainbow flag of Pride – testimony to the 49 lives lost in the senseless shootings in an Orlando nightclub, a flag which displays our solidarity with the families and communities they left behind.

“We continue to mourn the loss of our Parliamentary colleague Jo Cox [the murdered Labour MP]. I have never given up hope that we can recapture the new kind of politics from which this Parliament was born. But it takes determination to move away from the trench warfare of Party lines. It takes real purpose if we are to soften the binary divisions: yes or no, leave or remain.”

Diversity was also the theme of a special poem by Scots Makar Jackie Kay called Threshold, which incorporated Gaelic, Doric, Hindi, French, Syrian, German, Italian and Urdu, and referred to asylum seekers, refugees and the deportation-threatened Brain family.

The ceremony, which included performers from the Scottish Youth Theatre and a Piano Quintet by Tom Aitken, ended with former Ultravox singer Midge Ure on acoustic guitar singing Robert Burns’s A Man’s a Man for A’ That from a vantage point above the chamber. "The honest man, tho’ e’er sae poor, is king o’ men for a’ that,” he informed her majesty.