In the meantime, Carlist forces in Catalonia were extremely active in Girona and Tarragona. In March, a Carlist force commanded by Francesc Savalls laid siege to Olot (Girona) and frustrated the attempts to relieve the town by defeating a relief army led by Ramon Nouvilas at Castellfollit de la Roca on March 14. The battle ended with the capture of 2,000 men and Nouviles himself. Olot capitulated two days after the battle. Immediately, Catalan Carlists set their capital at Olot, forming a new government in San Joan de les Abadeses with Rafael Tristany as head of state. The main objective of the government was to establish a political administration of the territories held by Carlist forces in Catalonia. At Tarragona, Infant Alfonso started gathering his forces at Tortosa. Seeing an opportunity to gain the initiative, Republican Colonel Eulogio Despujol, victorious over Carlists at Caspe, attacked a Carlist stronghold led by Colonel Tomas Segarra at Gandesa on June 4, taking it and inflicting 100 casualties on the Carlists. This success, however, would be irrelevant in the outcome of the war, as Infante Alfonso gathered a 14,000-strong Carlist army and marched to Cuenca one month later. Cuenca, 136 kilometers from Madrid, capitulated after two days of siege and was brutally sacked, but a Republican counter-attack defeated the disordered Carlists, who withdrew beyond the Ebro River. In October, the splitting of Carlist armies of central Spain and of Catalonia, as dictated by Carlos VII, combined with the rivalries between commanders Savalls and Infante Alfonso, forced the latter to give up his command and to leave Spain.