Nicola Sturgeon was among those welcoming the couple to the Palace of Holyroodhouse for their final public engagement on their first joint official visit to Scotland.
A band from Impact Arts performed at the event and made a tongue-in-cheek pitch to play at the royal wedding on May 19.
Band member Darren Telford said: “What we said was that a little birdie had told us that Ed Sheeran was going to be playing an upcoming wedding and if he couldn’t make it, we are free if they wanted.”
During the visit the couple also saw 14-year-old gymnast Fraser Lynes show off his skills with a somersault, which he said Harry told him was “very impressive”.
The ambassador for the Glasgow 2018 European Championships said: “It was really good to meet them. They are really nice people.”
Harry and Ms Markle spoke to young people from different charities and organisations including the Edinburgh International Film Festival, the Scottish Youth Parliament and LGBT Youth Scotland, and heard a poem performed by pupils from Port Glasgow High School.
They were shown round by Charlotte Liddell, 21, from Buckhaven, Fife, and Ben Mason, nine, from East Renfrewshire, who are both youth ambassadors for the Scottish Government initiative Scotland’s Year of Young People 2018.