Harald was the third child and only son of King Olav V and Princess Märtha of Sweden. He was second in the line of succession at the time of his birth, behind his father. In 1940, as a result of the German occupation during World War II, the royal family went into exile. Harald spent part of his childhood in Sweden and the United States. He returned to Norway in 1945, and subsequently studied for periods at the University of Oslo, the Norwegian Military Academy and Balliol College, Oxford.