Charles met dozens of serving submariners at the Royal Naval Armaments Depot (RNAD) at Coulport, part of HM Naval Base Clyde.
He was welcomed by First Sea Lord Admiral Sir Ben Key KCB CBE and received the royal salute from several senior members of the Navy.
It marks the first time the King has visited the base as head of the armed forces, though he did visit in 2011 and 2013 as the Prince of Wales.
Commodore Paul Dunn OBE, of the Submarine Service, said: “His Majesty’s visit, his first here as commander-in-chief of the British armed forces, acknowledges the valuable service of our submariners.
“The Royal Navy’s unbroken 55-year record of continuous at sea deterrence is a tremendous source of pride, showcasing the skill, professionalism and dedication of our defence enterprise.
“This remarkable national endeavour, entrusted to us since 1969, has seen our submariners and their families make significant sacrifices in the defence of our country.”
The King also went aboard a Vanguard-class nuclear capable submarine, where he spoke to crew members about their roles and thanked them for their commitment.
He later met gold deterrent pin holders – submariners who have been honoured for their efforts in nuclear deterrence.
Chief Petty Officer (CPO) Longhurst and his family were among the submariners who met the King.
CPO Longhurst said: “Meeting the King with my wife and shipmates today was a truly special moment, marking the culmination of my service as a Royal Navy submariner.
“It has been a challenging but fulfilling 23 years, seven of which have been underwater.
“His Majesty’s visit today not only highlights the importance of the job we do in keeping the nation safe, but it also emphasises the invaluable support of our loved ones who stand by us through every deployment.
“Our families are the unsung heroes and today recognises that at the highest level.”
The geographic position of a Vanguard-class submarine on patrol is a secret not shared with the majority of the crew.
While at sea, submariners have little contact with the outside world.
However, one of the most important links with home is the arrival of the “Family Gram”, a 120-word one-way message that arrives weekly.
Patrolling submariners will also receive a snapshot of local and international news stories, as well as sporting results – all of which are vetted by the commanding officer.
Commodore Sharon Malkin ADC, naval base commander Clyde, said: “HM Naval Base Clyde has supported the UK’s deterrent submarines since 1968.
“The One Clyde team on base is a collaboration of serving naval personnel, veterans, civil servants, and industry partners – many of whom are part of the local community.
“His Majesty’s visit to the Clyde today is a tremendous honour for all of us involved.”