The Iberian Union was the dynastic union of the Crowns of Castile and Aragon and the Kingdom of Portugal that existed between 1580 and 1640 and brought the entire Iberian Peninsula, as well as Portuguese and Spanish overseas possessions, under the Spanish Habsburg monarchs Philip II, Philip III, and Philip IV. The union began after the Portuguese crisis of succession and the ensuing War of the Portuguese Succession, and lasted until the Portuguese Restoration War, during which the House of Braganza was established as Portugal's new ruling dynasty with the acclamation of John IV as the new King of Portugal. As a personal union, the Kingdoms of Portugal and Spain remained independent states, sharing only a single monarch. The kings from the Spanish branch of the House of Habsburg were the only element that connected the multiple kingdoms and territories, ruled by the six separate government councils of Castile, Aragon, Portugal, Italy, Flanders, and the Indies. The governments, institutions, and legal traditions of each kingdom remained independent of one another. Alien laws (Leyes de extranjería) determined that a national of one kingdom was a foreigner in all other kingdoms. Background The unification of the peninsula had long been a goal of the region's monarchs with the intent of restoring the Visigothic monarchy. Sancho III of Navarre and Alfonso VII of León and Castile had both taken the title Imperator totius Hispaniae, meaning "Emperor of All Hispania". There were many attempts to unite the different kingdoms after Alfonso VII's death in 1109, especially through a policy of intermarriage. Some of the most famous attempts are those of Miguel da Paz, who would inherit the crowns of Portugal, Leon, Castile, and Aragon, but who died at a young age; and those of Afonso, Prince of Portugal, who was to marry the eldest daughter of the Catholic Monarchs, if not for his untimely death by an accident in which he fell off his horse. Establishment The Battle of Alcácer Quibir in 1578 saw the death of the young king Sebastian. Sebastian's granduncle and successor, Cardinal Henry, was 66 years old at the time. Henry's death was followed by a succession crisis, with three grandchildren of Manuel I claiming the throne: Infanta Catarina, Duchess of Braganza (married to John, 6th Duke of Braganza), António, Prior of Crato, and King Philip II of Spain. António had been acclaimed King of Portugal by the people of