Leopold I (name in full: Leopold Ignaz Joseph Balthasar Felician; Hungarian: I. Lipót) Habsburg (9 June 1640 5 May 1705), Holy Roman emperor, King of Hungary, King of Bohemia, was the second son of the emperor Ferdinand III and his first wife Maria Anna of Spain. His maternal grandparents were Philip III of Spain and Margaret of Austria. He was also a first cousin of his rival, Louis XIV of France. He became heir apparent on 9 July 1654 by the death of his elder brother Ferdinand IV, and reigned as Holy Roman Emperor from 1658 to 1705. Leopold's reign was marked by military successes against the Ottoman Empire in the Great Turkish War.