The massive baroque palace and monastery which dwarfs the small town of Mafra, was built during the reign of Portugal's most extravagant monarch, Joao V. It began with a vow by the young king to build a new monastery and basilica, supposedly in return for an heir (but more likely to atone for his well-known sexual excesses).
Work began in 1717 on a modest project to house 13 Franciscan friars but, as wealth began to pour into the royal coffers from Brazil, the king and his Italian trained architect, Johann Friedrich Ludwig (1670-1752), made ever more extravagant plans.
No expenses was spared: 52,000 men were employed and the finish project housed not 13 but 330 friars, a royal palace, and none of the finest libraries in Europe, decorated with precious marbles, exotic woods, and countless works of art. The magnificent basilica was consecrated on the king's 41st. birthday, October 22, 1730, with festivities lasting eight days.
The palace was never a favorite with the members of the royal family, except for those who enjoyed hunting deer and wild boar in the adjoining tapada (hunting preserve).
Most of the finest furniture and art works were taken to Brazil when the royal family escaped the French invasion in 1807.
The monastery was abandoned in 1834 following the dissolution of all religious orders, and the palace itself was abandoned in 1910, when the last Portuguese king. Manuel II, escaped from here to the Royal Yacht anchored off Ericeira.