Prince William was "delighted" the Queen was among leading Royals attending his graduation ceremony at St Andrews University, he said.
William's 2:1 class degree beats his father's 2:2 from Cambridge
The prince, who attained a class 2:1 degree in geography, collected the honour at a ceremony on Thursday.
His father, Prince Charles, also attended, along with the Duchess of Cornwall and the Duke of Edinburgh.
William, 23, will spend the summer doing work experience in the City, as well as joining a mountain rescue team.
Hundreds of well-wishers lined the streets of the Scottish town to greet the Royal party.
After the ceremony, and still wearing his black silk graduation robe, Prince William shook hands with members of the public as he made his way to Fife constabulary to thank them for "their constant support" during his time at the Scottish institution.
"Today there is a great degree of interest in seeing him," said St Andrews resident Sybil Gray, 72.
"I also got a good look at the Queen who I thought looked very well and happy to be at her grandson's graduation."
The prince paid tribute to the people of St Andrews, saying he had "thoroughly enjoyed" his four years at the university and was "sad to leave".
"I just want to say a big thank you to everyone who has made my time here so enjoyable," he said.
"I have been able to lead as 'normal' a student life as I could have hoped for and I'm very grateful to everyone, particularly the locals, who have helped make this happen."
He also paid tribute to the Queen: "Today is a very special day for me and I am delighted that I can share it with my family, and in particular with my grandmother, who has made such an effort to come, having been under the weather."
Prince William, who has shown an interest in an Army career, will also learn land management on a country estate during the summer.
In 1982 the Queen accepted a miniature gown for the child prince
But first he will fly to New Zealand to meet the touring British and Irish Lions team.
While there he will also carry out his first solo engagements, on behalf of the Queen, by attending ceremonies in Wellington and Auckland in July to mark the anniversary of the end of World War II.
Prince William said he was looking forward to his work experience.
"I very much hope that these work placements will give me hands-on experience in three very different but important areas," he said.
"The work experience in the City was something I was particularly keen to do as I feel that this is an area in which I could learn a lot and it may well help me with charitable fund-raising in the future.
"The land management experience will hopefully allow me to develop skills and an understanding of how to best look after the countryside.
"Joining a mountain rescue team really appealed to me as I can learn at first hand how these amazing people help save lives on a regular basis."
William's 2:1 class degree beats his father's 2:2 from Cambridge, making him one of the most academically successful royals.