The Queen fed carrots to racehorses at the stables of champion trainer Paul Nicholls during a visit to Somerset.

She travelled on the Royal Train to Castle Cary station, where she was presented with a posy.

Her first engagement was at Manor Farm Stables in Ditcheat, where she met Mr Nicholls and six of his National Hunt horses.

The Queen wore an Angela Kelly lime green and ivory summer tweed dress with coat and matching hat.

Queen Elizabeth II visits Somerset
The Lord Lieutenant of Somerset, Annie Maw, greets the Queen as she arrives at Castle Cary station on the Royal Train (Ben Birchall/PA)

The six horses – including Frodon and Clan Des Obeaux, which is co-owned by Sir Alex Ferguson – were paraded before her.

She fed them carrots before hearing from researchers from the University of Bath who are working on projects on equestrian sport spinal injuries and racehorse welfare.

Before leaving the stables, the Queen was presented with a posy by Mr Nicholls’ eight-year-old daughter Zara, and a hamper from local cheesemaker Barber’s.

Queen Elizabeth II visits Somerset
The Queen is presented by trainer Paul Nicholls with a photograph of himself and the Queen Mother (Andrew Matthews/PA)

Mr Nicholls also gave the Queen a framed black and white photograph of the Queen Mother presenting him with the Hennessy Gold Cup in 1987.

Speaking after the visit, he described the occasion as “amazing”.

“It was a fantastic experience to bring Her Majesty to the yard and meet the superstar horses. I was more nervous about today then I was about the Cheltenham Festival,” he said.

“She loved seeing the horses and gave them all a carrot, and she knew as much about them as we do.

“She saw them run at Cheltenham and she knows what she is talking about and loved feeding them.

“I have been lucky enough to meet the Queen several times and she is obviously a racing enthusiast.”

Queen Elizabeth II visits Somerset
There was a warm welcome for the Queen when she arrived at King’s Bruton School to mark its 500th anniversary and open the new Music Centre (Ben Birchall/PA)

Mr Nicholls added: “I jokingly said to the Queen that box one is currently empty and we have space for one of her horses.”

Professor Keith Stokes and Dr Dario Cazzola, from the University of Bath’s Department for Health, presented their new project with the British Horseracing Authority to the Queen.

Their research, building on previous injury prevention work within rugby unions, focuses on spinal injury reduction for jockeys.

It will be combined with research carried out at the British Racing School in Newmarket to highlight links between certain types of falls and increased chances of spinal injury.

The Queen later visited the Hauser & Wirth Somerset gallery
The Queen later visited the Hauser & Wirth Somerset gallery (Toby Melville/PA)

Prof Stokes said: “Spinal injuries can have a dramatic impact on people’s lives and using the digital archive to inform strategies that have the potential to reduce the risk of these injuries is extremely valuable.

“Today was an exciting opportunity to showcase to Her Majesty the important impact we hope to make with these projects in improving safety in horse racing.”

The Queen was also told about the work of Dr Ben Metcalfe, who is developing a sensor platform for race horses to give trainers and veterinary professionals real-time data on horse fitness and well-being.

His device, the EquiVi, is a non-invasive wearable device – similar to fitness and activity trackers used by humans.

Annie Maw, the Lord-Lieutenant of Somerset, met the Queen when she arrived at the railway station.

“As a paraplegic – the result of falling from a horse – I take a particular interest in these issues,” said Ms Maw.

“I sincerely hope that this work could help reduce incidence of what is a truly devastating injury.

“I am delighted we have been able to showcase this important work to Her Majesty during the recent royal visit to Somerset.”

After her visit to the stables, the Queen visited King’s Bruton, a co-educational school founded in 1519, to mark 500 years of the school.

Avon and Somerset Police said around 400 well-wishers were at the school to give the Queen “a right royal welcome”.

Later, the Queen was due to name a police horse during the visit, her first to the county since the 2012 Jubilee tour of the UK.

On that tour, she named a police horse Jubilee, and was expected to meet it again on Thursday.