Over the next two centuries, Catalonia was generally on the losing side of a series of wars that led steadily to more centralization of power in Spain. Despite this fact, between the 16th and 18th centuries, the role of the political community in local affairs and the general government of the country was increased, while the royal powers remained relatively restricted, specially after the two last Courts (1701–1702 and 1705–1706). Tensions between the constitutional Catalan institutions and the gradually more centralized Monarchy began to arise. In 1626 the Count-Duke of Olivares, minister of Philip IV, tried to establish the military contribution of the states of the Monarchy, the "Unión de Armas" (Union of Arms), but the resistance of Catalonia to the project was strong. This events, alongside other factors such as the economic crisis, the presence of soldiers and the peasants' revolts led to the Reapers' War, also called Catalan Revolt (1640–1652), in the context of the Franco-Spanish War, in which Catalonia, led by the president of the Generalitat, Pau Claris, briefly declared itself as an independent republic under French protection in January 1641, and later joined the Monarchy of France, appointing king Louis XIII as count of Barcelona, but, after the first military successes the Catalans were finally defeated and reincorporated into the Crown of Spain in 1652.