Question: what was the capital of brazil before brasilia
Answer: São Salvador da Bahia de Todos os Santos ( 1534 -- 1763 ) Salvador ( 1572 -- 1578 / 1581 ) -- capital city of the State of Maranhão Salvador ( 1621 -- 1640 ) -- capital city of the State of Maranhão under the Iberian Union São Sebastião do Rio de Janeiro ( 1572 -- 1578 / 1581 ) -- capital city of the State of Brazil Rio de Janeiro ( 1763 -- 1815 ) -- capital city of the Viceroyalty of Brazil Rio de Janeiro ( 1815 -- 1822 ) -- capital city of the United Kingdom of Portugal , Brazil and the Algarves Rio de Janeiro ( 1822 -- 1889 ) -- capital city of the Empire of Brazil Rio de Janeiro ( 1889 -- 1960 ) -- capital city of the Republic of the United States of Brazil Brasília ( 1960 -- present ) -- capital city of the Republic of the United States of Brazil , and