The Queen has joined politicians to mark 20 years of Scottish devolution.
She was accompanied by her son Prince Charles, who holds the title of the Duke of Rothesay in Scotland.
Legal powers were officially passed to Holyrood on 1 July 1999 – and young people born on that date accompanied members of Scottish parliament (MSPs) at the event.
The Queen wore a blue coat and hat and a white floral dress for the occasion, and spoke of her affection for Scotland during her address.
She said: “We fondly remember that proud day when new members gathered in the Assembly Hall to celebrate Scotland’s first parliament in 300 years.
“It has been with great pleasure that over the years I have watched Scotland grow and prosper, and have been with you at each stage of your parliamentary life, including on landmark occasions such as today.
“Twenty years on, this chamber continues to be at the centre of Scottish public life, as an important forum to engage and unite diverse communities and also a home for passionate debate and discussion.
“Through new initiatives you continue to strive to be responsive and accountable to the people you serve, and to engage and involve those who might not otherwise participate in political debate.”
Queen Elizabeth also reminded MSPs that while the word parliament has the meaning of a “place to talk” it should also be a “place to listen… and a place to honour those views”.
Speeches through the ceremony have been mixed with performances of music and poetry.
Nicola Sturgeon, the Scottish first minister, reflected on the “optimism” of its members when the parliament was first opened.
In her speech, she said: “There were times perhaps, especially in the first few years of the parliament, when the sense of challenge possibly outweighed the sense of optimism.”
She added there had been times where the parties in Holyrood had “passionately disagreed” on many issues, but highlighted when they worked together.
Ms Sturgeon said: “The 290 acts this parliament has passed have varied in their impact. But from land reform in the first parliament to equal marriage in the last to the Social Security Act in this, they have all made Scotland a better place.
“As a result this parliament is firmly established as the centre of this nation’s public life. We have become the democratic institution which people look to, to reflect their priorities, values, hopes and dreams.
“And we are now looking forward to a new decade in which this parliament will build new institutions and I am sure see further change and development.”
The SNP leader said the MSPs should maintain their commitment to working together even when politics seems more “divisive and confrontational than ever”.
Leader of the Scottish Conservatives Ruth Davidson also made a speech reflecting on her own position at the time, watching the ceremony at the students’ union in Edinburgh University.
Ms Davidson said: “I didn’t know then what a Scottish parliament would look or sound like.
“How it would change the political landscape and grow to dominate our country’s public life.
“But there was a sense that for our generation the equation had changed, that evolution offered new possibilities, not just for Scotland but all our family of nations.”
She said Holyrood is now a “fixture of political and civil life” in Scotland.
Before the Queen arrived, the Crown of Scotland was brought in a procession from Edinburgh Castle to Holyrood, carried by the Duke of Hamilton and accompanied by the pipes and drums of the first battalion of the Scots Guards.
Ms Sturgeon and Holyrood’s presiding officer Ken Macintosh were elected as MSPs in 1999.