In time, the counties of the region gave up their allegiance to the rulers of the Franks and their successors and became attached, as a self-governing principality under the Count of Barcelona, to the Crown of Aragon. Catalonia became the main base for the Crown of Aragon's naval power and expansionism, that spread intoValencia, the Balearic Islands, and later into Sardinia, Sicily, Naples and, briefly, Athens. An identifiably Catalan culture developed in the later Middle Ages under the hegemony of the counts of Barcelona.
The marriage of Ferdinand II of Aragon and Isabella I of Castile in 1469 laid the foundations for a unified Crown of Spain. In 1492, the Emirate of Granada, the last political entity of al-Andalus in the peninsula, was conquered and the Spanish discovery and conquest of the Americas began. Political power began to shift away from the Crown of Aragon towards Castile.
For a considerable time, Catalonia retained its own laws as a principality of the Crown of Aragon but this came to an end when the new Bourbon dynasty secured the throne of Spain in the War of Spanish Succession and made the former Crown of Aragon territories into provinces of the Crown of Castile following the war. During the war, Catalonia had supported the claim of a member of the Austrian branch of the Habsburg dynasty (after breaking an oath of loyalty to the French Bourbon prince Philip of Anjou (Philip V of Spain) from 1702). Following the surrender of Catalan troops on September 11, 1714, Philip V's enacted the Nueva Planta decrees banning all the main traditional Catalan political institutions and rights and merged its administration into that of the Crown of Castile as a province. However, the Bourbon monarchy allowed for Catalonia's civil law code to be maintained. With the exception of the loyal Basque Country, the new Bourbon king, Philip V of Spain, abolished the ancient privileges of all of Spain's medieval kingdoms, including the Crown of Aragon and with it, those of the Principality of Catalonia. Following the model of France, he imposed a unifying legislation and administration across Spain, as well as introducing the French Sallic Law and founding Spain's own Royal Academy in 1714. This led to the eclipse of Catalan as a language of government and literature.