Many of them cried as they watched flames consume the building. Marco Aurelio Caldas, who worked at the museum for nine years, was overcome by the loss.
"This is 200 years of work of a scientific institution -- the most important one in Latin America," he told Agencia Brasil. "Everything is finished. Our work, our life was all in there."
A former royal palace
The palatial National Museum building used to be the home of a Portuguese royal family. Almost exactly 200 years ago, it was converted into a museum.
Since then, the National Museum has become Brazil's oldest historical institution and an internationally prominent research center.
"Two hundred years of work, research and knowledge were lost," President Temer said after the fire. "It's a sad day for all Brazilians."
The museum housed 20 million artifacts in areas such as biological anthropology, archeology, ethnology, geology, paleontology and zoology,
according to its website.
One of the museum's most famous artifacts is known as "Luzia," the skull and bones of a 25-year-old woman who died more than 11,000 years ago. They are the oldest remains ever discovered in Brazil, the museum's website says.
The largest meteorite ever found in Brazil is also housed in the museum. It weighs 5.36 tons and was found in 1784.
Other rare exhibits include thousands of works from the pre-Colombian era, such as mummified Andean skeletons.
The museum housed an impressive collection of ancient Egyptian artifacts, including mummies, sarcophagi, statues and stone carvings.
Minister of Culture Sergio Sa Leitao said the country "is in mourning."
"I have also asked for a complete evaluation of the fire preparedness conditions of every other federal museum in the country," he said, "in order to verify the steps that need to be taken to avoid another tragedy."
CNN's Joshua Berlinger contributed to this report