Throughout the 1630s, attempts to increase taxes to pay for the costs of the war in the Netherlands led to protests throughout Spanish territories; in 1640, these erupted into open revolts in Portugal and Catalonia, supported by Richelieu as part of his 'war by diversion'. Prompted by France, the rebels proclaimed the Catalan Republic in January 1641. The Madrid government quickly assembled an army of 26,000 men to crush the revolt, and on 23 January, they defeated the Catalans at Martorell. The French now persuaded the Catalan Courts to recognise Louis XIII as Count of Barcelona, and ruler of the Principality of Catalonia.