Ajuda Palace was built in the place where previously there was a temporary wooden building built for the royal family after the earthquake in 1755 and the tsunami. Originally, the building was designed in the late Baroque-Rococo style by the architect Manuel Caetano de Sousa. However, later the work was entrusted to the architects Francisco Xavier Fabri and José da Costa e Silva. Their design represented a building in the neoclassical style.
Due to political conflicts and financial problems, the construction of the palace was divided into several stages. After the royal family's escape to Brazil in 1807, and the invasion of the French army in Portugal, the work went much slower than planned. Fabri took over the project, followed by Antonio Francisco Rosa. Lack of sufficient financial resources significantly reduced the scale of the project. Finally, the construction of the palace, which began in 1796, lasted until the 19th century.