The reign of Leopold I lasted for forty-seven years, making him one of the longest-ruling Habsburgs. However, he was not born to assume the office of ruler.
Leopold was the fifth child of Emperor Ferdinand III and his first wife Maria of Spain. His mother was a daughter of King Philip III of Spain and Archduchess Margarete, a daughter of Archduke Charles of Inner Austria. The latter appears several times in Leopold’s family tree, as Archduke Charles was his great-grandfather on both his mother’s and his father’s side. Leopold’s grandparents and parents were thus related many times over and he himself the result of the genealogical interconnection of the two dynasties over several generations.
At first the prince stood in the shadow of his elder brother, Crown Prince Ferdinand. Leopold is said to have been a delicate child, intended for a career in the Church on account of his reserved and pious nature, a disposition unanimously emphasized by his biographers. Leopold’s upbringing and education were typical of the Jesuit-inspired ideals of the Catholic Counter Reformation that were marked by religious intolerance and extreme piety.
When Leopold was fourteen he became heir to the throne after the sudden death of his elder brother. Three years later, in 1657, his father died and he assumed the regency, aged just seventeen. Acceding as emperor of the Holy Roman Empire proved more difficult than expected, as a number of electors were opposed to his election. The traditional Habsburg claim to the emperorship was challenged by France, which was increasingly interfering in the politics of the Empire. Louis XIV, who was to become Leopold’s lifelong rival, had a growing influence over a part of the electors and was himself at times brought into play as a candidate. Considerable diplomatic efforts on the part of the Habsburg faction were needed before the election was decided in favour of Leopold. The coronation eventually took place in the summer of 1658.
Because Leopold was still very young, political decision-making was initially determined by dominant personalities at court. Under the title of Obersthofmeister (head of the court household) various influential aristocrats such as Prince Johann Weikhard von Auersperg (1615–1677) or Prince Wenzel Eusebius von Lobkowicz (1609–1677) took the role of ‘head of government’, de facto singlehandedly determining policies in the name of the emperor. After the fall of Lobkowicz in 1674 Leopold assumed the reins of government himself.