Boris Johnson paid tribute to the Duke of Edinburgh's "amazingly distinguished naval career" during a visit to the college where Prince Philip was a cadet.
The Prime Minister said his thoughts were once more with the Queen, while at the Britannia Royal Naval College Dartmouth, which is where the young royal couple met for the first time in 1939.
King George VI and Queen Elizabeth visited the naval college with their two daughters, when Philip, then 18, and the 13-year-old Elizabeth had their first publicised meeting.
Prince Philip went on to serve for more than a decade in the Royal Navy.
Earlier this week, the Devon college paid tribute to its former student, describing Prince Philip as "the sailor's sailor".
In commemoration of the Duke, Mr Johnson attended a passing out parade at Dartmouth on Thursday.
He congratulated naval cadets as they became officers and spoke with them about their career ambitions.
Mr Johnson told reporters: "We've just seen those wonderful cadets become officers themselves and incarnating the finest traditions of the Royal Navy in the way that the Duke did himself.
"And actually, funnily enough, here in this very garden, I think in 1939, the Duke of Edinburgh met the then Princess Elizabeth for the very first time.
"So, our thoughts are with her again today."
In May 1939, Philip, then aged 17, entered the college as a special entry naval cadet for training, following in the footsteps of his paternal grandfather and uncles.
During the conflict, he served on several ships, firstly on HMS Ramillies, and saw active service against German, Italian and Japanese forces.
In August 1945, he also witnessed Japan's surrender in Tokyo Bay.
The then 24-year-old was posted to brand-new destroyer HMS Whelp and was escorting the USS Missouri when the Japanese surrender took place.
Watch: In 1995, Prince Philip recalled his actions during the Second World War that saw him mentioned in dispatches.
He said in an interview in 1995: "Being in Tokyo Bay with the surrender ceremony taking place in the battleship which was, what, 200 yards away.
"You could see what was going on with a pair of binoculars."
The Duke was also mentioned in dispatches for his role in the Battle of Cape Matapan, fighting against Italian forces off the south-west coast of Greece.
He ended his active naval career in July 1951.
The Armed Forces are continuing to prepare for Prince Philip's funeral at Windsor Castle on Saturday.
More than 730 personnel from all three services are taking part in the ceremony.