 In December 1864 , the dictator of Paraguay , Francisco Solano López , ordered the invasion of the Brazilian province of Mato Grosso ( currently the state of Mato Grosso do Sul ) , triggering the Paraguayan War . Four months later , Paraguayan troops invaded Argentine territory in preparation for an attack on Rio Grande do Sul . The situation in Rio Grande do Sul was chaotic , and the local military commanders were incapable of mounting an effective resistance to the Paraguayan army . The Baron of Porto Alegre offered to return to active duty , and on 21 July 1865 , the government gave him command of the Brazilian land forces in Rio Grande do Sul . He set out for Uruguaiana , a small town in the province 's west , where the Paraguayan army was besieged by a combined force of Brazilian , Argentine and Uruguayan units . 
