During the event, the pair heard performances from musicians and poets and met sportsmen and women, including adventurer Richard Parks, former Wales rugby player Scott Quinnell and Jonathan Ford, chief executive of the Football Association of Wales.

Prince Harry is taking his American bride-to-be on a tour of the UK’s towns and cities in the months leading up to their wedding so he can introduce her to her new home.

His full title is Prince Henry of Wales – and Ms Markle could end up with a title linking her to Wales after the couple get married.

In the unlikely event the Queen does not give the prince a dukedom on the morning of his marriage, Ms Markle would become Princess Henry of Wales after saying her vows.

At the scene – Jonny Dymond, BBC royal correspondent

As the sun began to dip over Cardiff Castle, snow spat and the cold deepened. The loyalty of Harry’n’Meghan watchers was being tested.

The not-quite-yet-royal couple were meant to be doing a walkabout just before two in the afternoon. But even being almost-Royalty does not protect one from that most prosaic of frustrations, a signal failure at Didcot.

So by the time the show rolled into the castle’s ground, the gathered children were singing to stay warm and the adults were maybe wondering quite why they had chosen this particular form of torture.

But the crowd’s patience was rewarded; the couple lingered as they strolled, chatting and taking gifts, enquiringly earnestly as to how long people had waited, smiling and laughing.

It’s fun – and easy – to be cynical about the whole thing; the flags being handed out, the dignitaries waiting nervously, the best laid plans being derailed by signal failures.

But the couple are charismatic crowd-pleasers. And there is serious intent in these visits – there’s the grandeur of a place like Cardiff Castle and then the more down to earth stuff at a leisure centre, involving sport and youngsters and social mobility, the stuff Harry cares about and wants to highlight everywhere he goes.

Image copyrightWales News ServiceImage caption People queued early to get a good spot in the castle grounds

Fans who gathered to meet the couple said their story was like a “fairytale”.

Jenna Quilter, 18 from Creigiau, near Cardiff, said: “It’s fascinating that she’s not the typical person you’d expect to become a future duchess and it’s just really interesting to see the public reaction to her.”

Abbie Smith, who is visiting Cardiff from Louisiana in the US, said: “In America this is like a fairytale. I think it’s really cool that she’s from the States and gets to experience the royal lifestyle as well.”

Haley Johnston, 26, from Charlotte, North Carolina, added: “I’m also from the States and I married a British soldier so we have a few things in common.”

Later on Thursday, the couple had a private tour of Star Hub, where they saw how StreetGames, an organisation the prince has worked with previously, is helping to make sport accessible to disadvantaged young people.

Crowds waited outside the leisure centre in Tremorfa to see them.

Niusha Tabrizi, nine, wrote a welcome in Welsh for the pair and said she was keen to see Ms Markle.