After leaving Gordonstoun in early 1939, Philip completed a term as a cadet at the Royal Naval College, Dartmouth, then repatriated to Greece, living with his mother in Athens for a month in mid-1939. At the behest of the Greek king, George II (his first-cousin), he returned to Britain in September to resume training for the Royal Navy. He graduated from Dartmouth the next year as the best cadet in his course.
During the Second World War, he continued to serve in the British forces, while two of his brothers-in-law, Prince Christoph of Hesse and Berthold, Margrave of Baden, fought on the opposing German side. Philip was appointed as a midshipman in January 1940. He spent four months on the battleship HMS Ramillies, protecting convoys of the Australian Expeditionary Force in the Indian Ocean, followed by shorter postings on HMS Kent, on HMS Shropshire, and in British Ceylon. 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.
On February 1, 1941, Philip was commissioned as a sub-lieutenant after a series of courses at Portsmouth, in which he gained the top grade in four out of five sections of the qualifying examination. Among other engagements, he was involved in the battle of Crete, and was mentioned in dispatches for his service during the battle of Cape Matapan, in which he controlled the battleship’s searchlights. He was also awarded the Greek War Cross. In June 1942, he was appointed to the destroyer HMS Wallace, which was involved in convoy escort tasks on the east coast of Britain, as well as the Allied invasion of Sicily.
Promotion to lieutenant followed on July 16, 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 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. 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.
He was present in Tokyo Bay when the instrument of Japanese surrender was signed. Philip returned to the United Kingdom on the Whelp in January 1946, and was posted as an instructor at HMS Royal Arthur, the Petty Officers’ School in Corsham, Wiltshire.