When Did Brazil Become a Country?

Brazil became an independent country in 1822. At that time it separated from Portugal. Since 1889 Brazim has remained a Republic country.