The Kingdom of Aragon (Reino d'Aragón; Regne d'Aragó; Regnum Aragoniae; Reino de Aragón) was a medieval and early modern kingdom on the Iberian Peninsula, corresponding to the modern-day autonomous community of Aragon, in Spain. It should not be confused with the larger Crown of Aragon, which also included other territories—the Principality of Catalonia (which included the former Catalan Counties), the Kingdom of Valencia, the Kingdom of Majorca, and other possessions that are now part of France, Italy, and Greece—that were also under the rule of the King of Aragon, but were administered separately from the Kingdom of Aragon.
In 1479, upon John II of Aragon's death, the crowns of Aragon and Castile were united to form the nucleus of modern Spain. The Aragonese lands retained autonomous parliamentary and administrative institutions, such as the Corts. The arrangement remained until the Nueva Planta decrees, promulgated between 1707 and 1715 by Philip V of Spain in the aftermath of the War of the Spanish Succession, centralised power in Spain.
Aragon was originally a Carolingian feudal county around the city of Jaca, which in the first half of the 9th century became a vassal state of the kingdom of Pamplona (later Navarre), its own dynasty of counts ending without a male heir in 922. The name Aragón is the same as that of the river Aragón, which flows by Jaca. It might derive from the Basque Aragona/Haragona meaning "good upper valley" (haran+goi+ona, where haran = "valley", goi = "upper, high", and ona = good). Alternatively, the name may be derived from the earlier Roman province of Hispania Tarraconensis.
On the death of Sancho III of Navarre in 1035, the Kingdom of Navarre was divided into three parts: (1) Pamplona and its hinterland along with western and coastal Basque districts, (2) Castile, and (3) Sobrarbe, Ribagorza and Aragon. Sancho's son Gonzalo inherited Sobrarbe and Ribargorza. His illegitimate son Ramiro received Aragon.