He took office under Marshal Serrano during 1874, after the pronunciamiento of General Pavia had done away with the Cortes and the Federal Republic. He vainly attempted to crush the Carlists in 1874, and to check the Alphonsist military conspiracy that overthrew the government of Marshal Serrano at the end of December 1874.
In 1876 a vigorous campaign against the Carlists, in which the young king took part, resulted in the defeat of Don Carlos and his abandonment of the struggle.
The government sent him to the front, directly the Carlist War broke out, as commandant of the province of Biscay, where he severely defeated the Carlists in many encounters.
At times he showed qualities as a guerillero quite equal to those of the Carlists, like Zumalacarregui and Cabrera, by his daring marches and surprises.
Twice he obliged the Carlists to raise the siege of Bilbao before he was appointed commander-in-chief of the northern army on the r7th of September 1836, when the tide of war seemed to be setting in favour of the pretender in the Basque provinces and Navarre, though Don Carlos had lost his ablest lieutenant, the Basque Zumalacarregui.