Throughout the 19th century, the population increased continuously up to 4,136 inhabitants in 1887. The town was the judicial administrative centre and hosted a criminal court during several decades. In the Spanish context, the century was affected by the Peninsular War, the conflicts between the Carlists and Liberals and the sale of Church lands.
During the first Carlist War, Sant Mateu was involved in several warlike episodes with the general Cabrera leading the Carlists (traditionalists). Perhaps, the most outstanding episode was the arrival of the royal expedition on the way to Madrid (July 1837), led by the pretender Carlos María Isidro, who stayed at the Marquis of Villores Palace. The numerous armed confrontations which took place in the town throughout the battle brought about the decline of a considerable part of the local heritage. The Dominican and Capuchin convents and the Palace of Montesa, already affected during the Peninsular War, suffered the consequences of the Carlist War considering that they were outside the town. The walls, which were partly rebuilt and reinforced because of the conflict, were knocked down once again in many of their sections. The Carlist defeat also brought about the exile of a lot of supporters from Sant Mateu, including the Pitarch family, musicians who succeeded as organists in France.
The sale of Church lands in the middle years of the century ended definitely with the Dominican and Capuchin communities. Their properties were expropriated and auctioned by the state. The convents, completely ruined after the war, disappeared. The Palace of the Order of Montesa suffered the same fate. The Order still existed but as an honorary post, although the eminent control of the territory was abolished.
There aren’t enough studies which describe the development of the town beyond this period. However, there are some important facts to note in the 20th century. Firstly, demographically speaking, the population decrease continued since the first decade. This process sped up after the Civil War due to the attractive power of the big cities, as well as, the La Gelà (heavy snowfall in 1956), when the town ran out of most of the planted vineyards in the municipal area.
In the context of the Second Spanish Republic, there was an important work on the educational area with the construction of new school facilities and the introduction of innovative pedagogical methodologies on the part of Célestin Freinet and Maria Montessori.
During the Civil War (1936-1939), the anarchist ideology gathered strength in the town, as well as in the region. Particularly in Sant Mateu, the CNT (anarchist trade union) confiscated some religious buildings which became warehouses or garages. A large part of the ecclesiastic heritage was destroyed. It is a great pain the burning of the Renaissance altarpiece of the main chapel in the Archpriestal Church and, especially, we regret the deaths resulting from the armed conflict and the before and after suppression.