The prince is on a two-month attachment with the Royal Navy
Prince William is to become the patron of an appeal to save Britain's last WWII submarine.
The prince, who is on a two-month attachment with the Royal Navy and is Commodore in Chief of Submarines, toured HMS Alliance on Tuesday.
He said it was of "great importance" that maritime heritage was safeguarded.
HMS Alliance, launched in 1945, was in service for more than 25 years and is now on show at the Royal Navy Submarine Museum in Gosport, Hampshire.
The 25-year-old prince said it was important for future generations to understand the sacrifice made by submariners.
The submarine has been on display at the museum since 1981 but urgent restoration is needed, which is expected to cost millions.
Prince William said: "I am delighted and honoured to become patron of the HMS Alliance conservation appeal.
"It is of great importance that such heritage is safeguarded to help future generations to understand the past heroism and sacrifice of Britain's submariners.
"I wish the appeal every success in its crucial efforts to preserve this historic submarine for the nation."
The fund was started in October 2007 and will run for two years to try to raise enough money for the vessel's conservation.
Vice-Admiral Sir Tim McClement, chairman of the appeal, said: "HMS Alliance is the only surviving World War II submarine and needs to be maintained as a lasting memory to those who served in submarines during the war."
During his visit to the museum, Prince William - known as Sub Lt Wales - opened a memorial dedicated to submariners who have died defending the UK.
An area of remembrance lists 5,300 personnel who have died between 1904 to the present day.
The prince's navy attachment is part of a project to familiarise the future monarch with the armed forces he will one day command.
He is already an officer with the Household Cavalry's Blues and Royals and has also completed a four-month attachment with the RAF.