His mission was to end the conflict with Uruguay so that Brazil could focus on the far more serious threat posed by Paraguay. He arrived in the Argentine capital, Buenos Aires, on 2 December 1864.[80] Paranhos signed a peace treaty with the Uruguayan government on 20 February 1865, ending the war.[81] Paranhos not only managed to bring about peace, but he concurrently forged an alliance between Brazil, Argentina and the Uruguayan rebels (who formed Uruguay's postwar government) against Paraguay. The pact would later be officially signed as the Treaty of the Triple Alliance.[82]