When he returned to the Spanish mainland, he participated in the Third Carlist War but was seriously wounded during the Battle of Castellfullit in July 1874 when he was promoted to Commander.
Once he arrived in Cuba, he was in charge of several operations as he commanded several battalions until the Pact of Zanjón was signed and he returned to Spain to marry Matilde Sáenz Santa María.
There he would serve various posts, including becoming King Alfonso XII's aide-de-camp in 1886, commanding the Ciudad Rodrigo Battalion in Madrid and dealing with the uprising of the Garellano and Albuera regiments on September 19 as he left with his unit under the orders of Captain General Manuel Pavía in pursuit of the rebels along the Paseo de Atocha, Vallecas, Morata de Tajuña and Arganda.
[1] Desiring to save the Visayas and Mindanao from being conquered by Philippine revolutionary forces, de los Rios asked Spain to grant some reforms demanded by citizens of Iloilo.
He issued in Iloilo a proclamation to the people of the Visayas calling on them to establish a "Council of Reforms" to be made up of 24 leading citizens, 12 of whom would be selected by popular vote and another 12 to be appointed by the governor-general himself.
The outcome of the negotiations was the evacuation of Molo and Iloilo City by the Spanish troops and their subsequent surrender to the native forces under the command of Gen. Martin Delgado at Plaza Alfonso XII (now Plaza Libertad) on 23 December 1898, which implied Iloilo City as the last capital of the Spanish Empire in Asia and the Pacific.
[2]: 511 He left Iloilo and transferred temporarily to Real Fuerza de Nuestra Señora La Virgen del Pilar de Zaragoza in Zamboanga bringing with him the remnants of his colonial forces in the Visayas on the eve of the surrender of the Spanish forces in Visayas to the Ilonggo revolutionaries on December 24, 1898.