Firefighters are tackling the blaze at the building, which contains more than 20 million items in its collection.
It is not yet clear if anyone has been injured in Sunday's fire.
The museum, which once served as the residence for the Portuguese royal family, celebrated its 200-year anniversary earlier this year.
Images broadcast on Brazilian television showed how the fire, which is believed to have started after the facility had closed for the day, had spread throughout the building.
The cause of the fire is not yet known.
Brazil's President Michel Temer said in a tweet that it was a "sad day for all Brazilians", adding: "The value of our history cannot be measured by the damage to the building."
In an interview with Brazil's TV Globo, the museum's director said it was a "cultural tragedy".
The museum houses thousands of items related to the history of Brazil and other countries including Egyptian artefacts, according to its website.
Its natural history collection includes important dinosaur bones and a 12,000-year-old human skeleton of a woman - the oldest ever found in the Americas.
Employees had reportedly previously expressed concern about funding cuts and the dilapidated state of the building.