After leaving Gordonstoun in 1939, Prince Philip joined the Royal Navy, graduating the next year from the Royal Naval College, Dartmouth, as the top cadet in his course.[17] He was commissioned as a midshipman in January 1940. Philip spent four months on the battleship HMS Ramillies, protecting convoys of the Australian Expeditionary Force in the Indian Ocean, followed by shorter postings on HM Ships Kent, Shropshire and in Ceylon (now Sri Lanka). After the invasion of Greece by Italy in October 1940, he was transferred from the Indian Ocean to the battleship HMS Valiant in the Mediterranean Fleet.[18] Among other engagements, he was involved in the Battle of Crete, was mentioned in despatches for his service during the Battle of Cape Matapan where he controlled the battleship's searchlights.
Philip was also awarded the Greek War Cross of Valour.[17] Duties of lesser glory included stoking the boilers of the troop transport ship RMS Empress of Russia.[19]
Prince Philip of Greece and Denmark was promoted to sub-lieutenant after a series of courses at Portsmouth in which he gained the top grade in four out of five sections.[20] In June 1942, he was appointed to the V and W class destroyer and flotilla leader, HMS Wallace, which was involved in convoy escort tasks on the east coast of Britain, as well as the allied invasion of Sicily.[21] Promotion to lieutenant followed on 16 July 1942. In October of the same year he became first lieutenant of HMS Wallace, at 21 years old one of the youngest first lieutenants in the Royal Navy. During the invasion of Sicily, in July 1943, as second in command of HMS Wallace, he saved his ship from a night bomber attack. He devised a plan to launch a raft with smoke floats that successfully distracted the bombers allowing the ship to slip away unnoticed.[21] In 1944, he moved on to the new destroyer, HMS Whelp, where he saw service with the British Pacific Fleet in the 27th Destroyer Flotilla.[22][23] He was present in Tokyo Bay when the instrument of Japanese surrender was signed. In January 1946, Philip returned to the United Kingdom on the Whelp, and was posted as an instructor at HMS Royal Arthur, the Petty Officers' School in Corsham, Wiltshire.[24]