At the same time, Pedro II worked to prevent quarrels between the national political parties from impairing the military response. The Emperor prevailed over a serious political crisis in July 1868 resulting from a quarrel between the cabinet and Luís Alves de Lima e Silva (then-Marques and later Duke of Caxias), the commander-in-chief of the Brazilian forces in Paraguay. Caxias was also a politician and was a member of the opposing party to the ministry. The Emperor sided with him, leading to the cabinet's resignation. As Pedro II maneuvered to bring about a victorious outcome in the conflict with Paraguay, he threw his support behind the political parties and factions that seemed to be most useful in the effort. The reputation of the monarchy was harmed and its trusted position as an impartial mediator was severely impacted in the long term. He was unconcerned for his personal position, and regardless of the impact upon the imperial system, he determined to put the national interest ahead of any potential harm caused by such expediencies.