Prince Philip was greeted by cheering pupils as he arrived to open a new building at Bourne Grammar School yesterday.
The Duke of Edinburgh officially opened a systems, control and computing building at the school.
He arrived at 3.30pm and was welcomed by the Lord Lieutenant of Lincolnshire, Tony Worth.
The royal visitor then met assembled dignitaries, including mayor of Bourne Helen Powell, before moving in to the school for a tour of the new building.
Afterwards he was treated to a reception and tea in the main hall with governors, prefects, heads of house and teachers.
Headteacher Jonathan Maddox said:”It has been a spectacular day. He is a wonderful man to be with.
“It has been a highlight for the school’s history and indeed the town, as he is the most senior Royal to visit Bourne.”
The school closed earlier than usual and pupils were sent home on the day, with those not involved in the tour allowed to return to see the Duke’s visit.
Many lined the car park and clapped and cheered as he arrived.
Aimee West, 16, from Bourne, said: “It’s very rare that anything like this happens.
“It’s really exciting. It’s not every day that a Royal comes to visit Bourne.”
And pupil James Brooks, 12, who saw the Duke arrive, said “This is a huge day for Bourne.”
The new building is named The Turing Centre after the father of computer science Alan Turing.