Stjernfelt graduated from the Royal Swedish Naval Academy in 1940 and was commissioned as an officer and assigned to Vaxholm Coastal Artillery Regiment on 9 April, earlier then planned due to the German attack on Denmark and Norway. On the same day, he had to mobilize a preparedness unit in the inlet towards Stockholm. Already as a young lieutenant, he became battery commander of an artillery battery on the island of Roten in the northern Sea of Åland, a battery that kept full combat readiness throughout the World War II. At an early age he developed a great interest in military history. Shortly after the end of World War II, he cycled with his new wife Borghild along the invasion coast of Normandy, gathering information both in the terrain and from the German commanders who led the defence there. This resulted in the book "Alarm i Atlantvallen" ("Alarm in the Atlantic Wall"). A French edition of this book prompted an appreciative letter from general Charles de Gaulle.