The palace was not occupied permanently by the royalty, who considered the rooms too gloomy. Nonetheless, it was a popular destination for the members of the royal family who enjoyed hunting in the nearby game preserve, the "Tapada Nacional de Mafra". During the reign of King John VI the palace was inhabited for a whole year in 1807. The king was responsible for a partial renovation of the building by some well-known artists. However, with the French invasion of Portugal, in 1807, the royal family fled to Brazil, taking with them some of the best pieces of art and furniture in the building. Marshal Junot took up residence in the palace, to be driven out in turn by Wellington.