Prince Edward and Sophie Countess of Wessex met schoolchildren outside the castle who were waving flags in their honour.
The Earl and Countess of Wessex were then taken on a tour of the castle, meeting the stone sculptor, and chatting with embroiderers doing embroidery work.
They visited the police museum in the castle and chatted with members of staff, police cadets and Lancashire Police and Crime Commissioner Andrew Snowden.
Before they left they enjoyed refreshments in the cafe at the castle.

. Royals meeting schoolchildren
Prince Edward and Sophie of Wessex meet local schoolchildren on their visit to Lancaster Castle. Picture by Dan Martino. Photo: Dan Martino

. Sophie Countess of Wessex meets schoolchildren
Sophie Countess of Wessex meets local schoolchildren on a visit to Lancaster Castle. Picture by Dan Martino. Photo: Dan Martino

. Chatting to schoolchildren at the castle
Prince Edward and Sophie Countess of Wessex meet and chat with schoolchildren at Lancaster Castle. Picture by Dan Martino. Photo: Dan Martino

. Walking through John O' Gaunt gate
Sophie Countess of Wessex walks through the John O' Gaunt gate at the castle. Picture by Dan Martino. Photo: Dan Martino

1. Royals meeting schoolchildren
Prince Edward and Sophie of Wessex meet local schoolchildren on their visit to Lancaster Castle. Picture by Dan Martino. Photo: Dan Martino

2. Sophie Countess of Wessex meets schoolchildren
Sophie Countess of Wessex meets local schoolchildren on a visit to Lancaster Castle. Picture by Dan Martino. Photo: Dan Martino

3. Chatting to schoolchildren at the castle
Prince Edward and Sophie Countess of Wessex meet and chat with schoolchildren at Lancaster Castle. Picture by Dan Martino. Photo: Dan Martino

4. Walking through John O' Gaunt gate
Sophie Countess of Wessex walks through the John O' Gaunt gate at the castle. Picture by Dan Martino. Photo: Dan Martino