He composed the music of "A Portuguesa", the Portuguese national anthem, in 1891, with lyrics by poet and playwright Henrique Lopes de Mendonça; it was officially adopted in 1911, after the proclamation of the Republic the previous year. Ironically, he died, in Hamburg, almost exactly three years before the first day of the Revolution.