After major setbacks, from 1644 Spanish forces had driven out the French and crushed the Catalan forces, and by 1652 Barcelona and most of Catalonia was once under control of the Monarchy of Spain, but Catalonia gained recognition of its rights from the Spanish Habsburg monarchy, with few exceptions. When the war between Spain and France ended in 1659, the peace treaty ceded the Catalan-speaking territories north of the Pyrenees, Roussillon, Conflent, Vallespir, Capcir, and the northern half of Cerdanya, to France.