Before the current melody, the "Hino da Independência," composed by Emperor Dom Pedro I himself, served as the national anthem until 1831. Linguistic and Musical Style All You Need to Know About the Brazilian National Anthem
The music was composed by Francisco Manuel da Silva . It was first performed in public on April 13, 1831, to celebrate the abdication of Emperor Dom Pedro I and the accession of Pedro II. April 13 is now recognized as the "Day of the Brazilian National Anthem". Hino Nacional do Brasil - Oficial
The current, definitive lyrics were written by Joaquim Osório Duque-Estrada in 1909. They were officially adopted via a decree by President Epitácio Pessoa on September 6, 1922, to coincide with the centennial of Brazil's independence. Before the current melody, the "Hino da Independência,"