The Civil Code of Catalonia (in Catalan: Codi Civil de Catalunya) is the main codified law of civil law in force in Catalonia, adopted in 2002 and organized into six books.
The civil law of the Principality of Catalonia, created over time during the Middle Ages and early modern period, survived the suppression of Catalan institutions and laws that took place after the defeat in the War of the Spanish Succession in 1716. The Decrees of Nueva Planta, promulgated by the King of Spain, Philip V, respected this law while simultaneously abolishing the institutions and the other rights of the Principality. However, with the Catalan Courts (the parliament) abolished, the law remained without modifications for the next two centuries.
During the 19th and 20th centuries, and despite the enactment of a new Spanish Civil Code, Catalan nationalists successfully protected their separate civil law, though it was not until 1960 that the laws began to be compiled. The "Compilation of the Special Civil Right of Catalonia" (Spanish: Compilación de derecho civil especial de Cataluña) was approved in 1960 and, when Catalan autonomy was restored in 1980, the Parliament of Catalonia ended the first phase of compilation; it approved law 13/1984, which adapted the compilation to democratic post-Franco Spain, as well as adapting several new special laws.
During the last years of the 20th century, the Parliament began the process of codification of the civil law. In this spirit, in 2002 it approved the "First Book of the Civil Code of Catalonia." The other books were approved over the course of the following decade. Currently, only the Sixth Book is pending approval.