The 400th birthday celebrations of Ilkley Grammar School began in a right royal fashion yesterday with a short visit by Her Royal Highness the Princess Royal.

Princess Anne was greeted at the gates of the school by a percussion orchestra before stepping inside to meet Gillian James, the head teacher, The Lord Mayor and Lady Mayoress of Bradford, governors staff and pupils.

As the princess - dressed in a brown camel coat with matching handbag, black boots and silk scarf - entered the school she was welcomed by a delegation from the school's History Society who have been researching its long year history.

Mrs James explained to the Princess how, in 1964, a previous Princess Royal, Princess Mary, Countess of Harewood, had formally opened the school's extensions and renovations of the time.

As she later unveiled a plaque in the school's new extension building, the Princess explained how the previous Princess Royal had been her great aunt.

She said: "It is a pleasure to start your celebrations and a pleasure to visit you briefly." She added that she hoped that other planned events to celebrate the birthday would raise the profile of the Cowpasture Road school even more.

Governor Susan Cuthbertson said that the visit was the perfect start for the year of events. She said: "When I became a governor three years ago I did not expect to meet royalty, but I think it is a great boost for the school and a great privilege to have her come here."

During her tour, the Princess was shown the information technology classroom by teacher Kevin Cheater. She chatted with pupils, asking about the e-mail systems they used in class and at home.

The Princess, accompanied by the Lord Lieutenant of West Yorkshire, Ingrid Roscoe, met the cast of the school theatrical production School - The Scandal' before watching two short scenes from it.

The school production, co-written by the Heads of Music and Drama, Keiron Anderson and Kathie McLelland, is based on the school's history (albeit with a mischievous twist!).

Information technology pupil, Annabel Prike, 14, could not wait to tell her family what had happened during the visit but admitted it had been nerve wracking to speak to royalty.

She said: "I was so nervous - I was shaking so much. My gran has met her before and loves the royal family. She will be so pleased I have met her."

Mrs James accompanied the Princess visiting chemistry and English classes in the new block. The Princess expressed surprise that the school could fit in its 1,500 pupils on such a small site.

She was presented with a posy of flowers by Beverley McGillivray, 16, and a cheque for her charity Save the Children for £100 by 15-year-old Simon Collinson.

After the visit Mrs James said: "We were delighted she came and we feel very positive about the visit. She was interested in the students and in the history of the school - it was difficult drawing her out of the classroom.

"We are delighted she could launch the celebration."

Mrs James said she was also pleased with the way the students had responded to the visit. "We are proud of how the conducted themselves and it is a privilege to be part of this school."

The chairman of the governors Ros Beeson said: "It has been really exciting. I was here this morning for a meeting which was fairly normal but there was a real sense of excitement about the school.

"This was the first big event for the year and we were really pleased to have the Princess Royal coming."

As part of her trip to West Yorkshire, the Princess visited a market research company in Wetherby, joined the 60th anniversary celebrations of Halifax company Timeform Ltd, and opened a new sports complex at Rishworth School.