The Treaty of Rio de Janeiro was a diplomatic agreement signed in 1825 between Brazil and Portugal, formally recognizing Brazil's independence after a protracted struggle that began in 1822. This treaty marked the end of the conflict between the two nations and established diplomatic relations, solidifying Brazil’s status as a sovereign nation and allowing it to pursue its own political and economic agenda.