By John Morrison
BBC Scotland correspondent
Crowds outside the ceremony stretched for half-a-mile
Graduation day has never been like this, not even at Scotland's oldest university.
Shortly after midday the 259 graduates, who received their scrolls at the same ceremony as the young man who is destined one day to become the king of Britain, emerged from the Younger Hall blinking into the St Andrew's sunshine.
They found a crowd of several thousand onlookers, a massive police presence and the international media camped on the pavement.
Although they have become accustomed over the last four years to seeing the second in line to the throne in the queue at Tesco, cycling through the town to lectures and drinking pints of lager in the pub this was probably the first taste for most of them of what lies ahead for Prince William.
He arrived at the Younger Hall with his housemate and girlfriend, Kate Middleton. The young prince waited until she had taken her seat before moving away to his own place.
Afterwards with the rest of the students sipping champagne in the sunshine, savouring the academic achievement, duty called for the prince.
He worked his way round the garden party, shaking hands and offering congratulations, flanked by his father and step- mum.
The royal, who had sought as normal a life as possible alongside other students from all walks of life, was slowly moving away from his friends and colleagues of the last four years.
Minutes later he left the university buildings for the last time after telling friends that he was now "going out into the big wide world".
A ripple of applause went through the crowd which packed the pavement on both sides of the street for at least half-a-mile. Someone shouted: "Well done William".
Clutching his MA Honours scroll in one hand, the prince turned and waved shyly at the well-wishers before shaking hands and thanking the senior university figures who have shepherded their most famous student through his four-year degree.
Afterwards, they stood and watched in the doorway as Prince William, Prince Charles and the Duchess of Cornwall walked half a mile down the street to the local police station where they thanked the local constabulary for their care and attention.
Prince William left behind 258 students reflecting on the words of the principal, who told them in his graduation address that St Andrews is a matchmaking university and that some of the students had already met their future partners.
The young graduates knew they had shared four years with the future king. But was his queen also among them?
The 259th student Kate Middleton may also have been reflecting on the words, in an entirely different way.