Workers at the distillery on Royal Deeside filled a cask in 1988 as a gift to the then-visiting prince, with the exclusive whisky to be bottled and sold for charity to mark his 70th birthday.
Sampling the single malt on Tuesday, Charles remarked on its initial sweet notes before describing it as “frightfully good”.
He has donated the contents of the cask to raise funds for The Carriage in nearby Ballater, a bistro and tearoom at the village’s newly restored Old Royal Station.
The historic stop was devastated by a fire in 2015 and has been brought back into public use with the help of The Prince’s Foundation.
Bottles of the special edition malt are expected to be purchased via a ballot run by The Whisky Exchange for around £1,200 each.
Ewan Andrew, director of distillery owner Diageo, said: “We are delighted to have welcomed His Royal Highness and to formally hand over this special cask, which will become the oldest single cask bottling of Royal Lochnagar Scotch whisky.
“We are particularly pleased that this will support the local community in Royal Deeside.”
The distillery next to the royals’ Balmoral Castle was called New Lochnagar when it opened in 1845 but was renamed Royal Lochnagar following a visit by Queen Victoria and Prince Albert in 1848.
It is the smallest of Diageo’s Scotch whisky distilleries and retains traditional methods of production.
During his visit, Charles filled and signed a new cask that will be matured for 12 years to raise funds for future charity projects.
He laughed as some of the malt spilled out and told workers “I’m glad to be here at the birth”.
Distillery manager Sean Phillips said the traditional methods they use to make whisky had not changed much since the first royal visit 170 years ago.
Mr Phillips said: “We are very proud of the whisky we make here and the way we make it.”
Charles met Royal Lochnagar brand manager Claire Fraser, 30, who was born the year the prince’s whisky was casked.
Her father Ian Fraser, 52, is an operator at the distillery and her grandmother Margaret Finnie, 72, was brand manager and secretary before retiring.
Both were present when Charles visited the site on two previous occasions in 1995 and 1998, and again on Tuesday.
Ms Fraser said: “It’s nice to continue the tradition and I can still go back to my granny and ask her questions if there are things I don’t know.”