Catalan nationalism is the ideology asserting that the Catalans are a distinct nation.
Intellectually, modern Catalan nationalism can be said to have commenced as a political philosophy in the unsuccessful attempts to establish a federal state in Spain in the context of the First Republic (1873-1874). Valentí Almirall i Llozer and other intellectuals that participated in this process set up a new political ideology in the 19th century, to restore self-government, as well as to obtain recognition for the Catalan language. These demands were summarized in the so-called Bases de Manresa in 1892.
It met very little support at first. But after the Spanish–American War in which the United States invaded and annexed the last of the Spanish colonies, these early stages of Catalanism grew in support, mostly because of the weakened Spanish international position after the war and the loss of the two main destinations for Catalan exports (Cuba and Puerto Rico).
During the first centuries of the Reconquista, the Franks drove the Muslims south of the Pyrenees. To prevent future incursions, Charlemagne created the Marca Hispanica in 790 CE, which consisted of a series of petty kingdoms serving as buffer states between the Frankish kingdom and Al-Andalus.
Between 878 and 988 CE, the area became a hotbed of Frankish-Muslim conflict. However, as the Frankish monarchy and the Caliphate of Córdoba both weakened during the 11th century, the resulting impasse allowed for a process of consolidation throughout the region's many earldoms, resulting in their combination into the County of Barcelona, which became the embryo of today's Catalonia. By 1070, Ramon Berenguer I, Count of Barcelona, had subordinated other Catalan Counts and intransigent nobles as vassals. His action brought peace to a turbulent feudal system and sowed the seeds of Catalan identity.
According to several scholars, the term "Catalan" and "Catalonia" emerged near the end of the 11th century and appeared in the Usatges of 1150. Two factors fostered this identity: stable institutions and cultural prosperity.