Prince William and fiancee Kate Middleton have visited the university where they first met, and said it felt "like coming home".
The couple, whose romance blossomed when they studied in St Andrews in Fife, returned for the university's 600th anniversary celebrations.
Thousands of people turned out to see their first official engagement in Scotland.
St Andrews has created a scholarship in the couple's honour, as a wedding gift.
Addressing students, university staff, and alumni, Prince William referred to his fiancee by her full Christian name, although she is usually known as Kate.
He said: "This is a very special moment for Catherine and me. It feels like coming home.
"Despite being one of Europe's leading research institutions, the third oldest university in the English-speaking world and of course, far and away the best university in the world, St Andrews has that uncanny knack of feeling like home.
"And so it must have done to generations of undergraduates before us, in fact 600 years' worth.
"It's knowing that so many of Scotland's finest brains and greatest achievers gained and continue to gain inspiration from this place that makes me so proud to be patron of the university's 600th anniversary appeal."
A reception inside the principal's residence, University House, was the first stop for the prince and Miss Middleton as they began their two-hour visit.
It was held in the hall where they had once attended History of Art lectures, and the couple spent time there reminiscing with members of the teaching staff and other guests.
There was a heavy police presence in the town, where some people waited for several hours under grey skies and lashing rain.
Ellen Dow, 66, from St Andrews, told the BBC: "I just couldn't miss this.
"I didn't see him the whole time he was studying here so I would really like to see him today.
"When he studied here he was about the streets but nobody bothered him so he had the town to himself.
"I'm very excited to see him today and I hope he comes to speak to me. I adore him, he's a wonderful person because he reminds me of his mother."
The prince and Miss Middleton carried out their first official engagement as a couple on Thursday, in Wales.
They attended a ceremony at a lifeboat station on Anglesey, where Prince William is currently based as an RAF rescue helicopter pilot and where the couple will set up their first home.
The pair, who are to marry on 29 April, met at St Andrews university and both graduated in 2005.
Prince William graduated with an honours degree in geography and Miss Middleton with an honours degree in history of art.
They have returned to Scotland's oldest university to launch a fundraising campaign to raise £100m for new scholarships and student support.
The scholarship created in their honour, which will have a value of up to £70,000, will be open to applicants from all nationalities.
It will be awarded annually to a student who without that kind of financial support would be unable to attend St Andrews.
The scholarship will meet the costs of tuition, if payable, accommodation and living expenses for a four-year undergraduate degree in science, arts, medicine or divinity.
Professor Louise Richardson, the university's principal and vice-chancellor, presented the gift.
She said: "This will be the first scholarship of its kind at St Andrews and a reflection of this university's commitment to ensure that we find, attract and support the most gifted students from anywhere in the world.
"It will guarantee that a high quality Scottish higher education can be available to any citizen of the world, that a lack of means need not be a barrier to study and that bright students who might otherwise have been unable to go to university can fulfil their potential.
"We were very pleased to make the offer of this scholarship as a wedding gift to Prince William and Miss Middleton and absolutely delighted that they have graciously accepted."
Hundreds of staff and students greeted the couple in St Salvator's Quadrangle, where Prince William unveiled a plaque to mark the launch of the 600th anniversary.
The couple also visited the university museum, where they were shown the Papal Bull from Pope Benedict XIII which conferred full university status on the institution in 1413.
The visit is Prince William's first in his role as patron of the anniversary fundraising campaign.
It has been given the support of some prominent alumni and friends of the university, including former US President Bill Clinton, Scotland's First Minister Alex Salmond, Sir Sean Connery and Harvard president, Drew Gilpin Faust.
After the visit, the couple travelled back to London to visit the New Zealand High Commission.
The Royal pair, and Prince Harry, signed a book of condolence in memory of the people who have lost their lives in the Christchurch earthquake.