On September 7, 1822. Prince Dom Pedro declared Brazil's independence from Portugal, who founded the Empire of Brazil, which later led to a two year war of independence. Recognition later came with a treaty that was signed both by Brazil and Portugal in the late 1825s.
hope this helps!