Trained as an officer in the Tsarist army, he rose to the rank of general, and, defeating the Finnish Bolsheviks (1918), he expelled the Soviet forces from Finland. He was appointed chief of the National Defence Council (1930–39), and planned the “Mannerheim Line”, a fortified line of defence across the Karelian Isthmus to block any potential aggression by the Soviet Union. When Soviet forces attacked (1939) he resisted in the Finnish–Russian War, and in alliance with Germany renewed the war (1941–44). In 1944 he signed an armistice with the Soviet Union. The Finnish Parliament elected Mannerheim as President (1944–46). In March 1945 he brought Finland into the war against Germany.