In the first half of the 18th century, King John V planned to build a summer residence in the Ajuda hill. The building of this Royal Palace in this place, however, would take place only after the Earthquake of 1755 which destroyed the royal residence, Paço da Ribeira (Ribeira Palace), at the Terreiro do Paço (Palace Public Square). On King José I 's initiative, the Royal Palace of Ajuda was built on the grounds acquired by his father firstly as a wooden building - commonly known as the Real Barraca (the Royal Hut) which burned to the ground in 1794 - and then as the Palace as it is nowadays.

The original project showed clearly Baroque architectural trends, but it was soon replaced by another in neoclassic style by the architects Francisco Xavier Fabri and José da Costa e Silva. Although the first stone was laid in 1795, only in 1802 did the construction of the Palace start. The Royal family had to leave to Brazil in 1807 and soon the works went on slowly along the first half of the 19th century. Only in 1861, after the proclamation of King Louis I (1838-1889) and after his marriage to the Princess of Savoy, Dona Maria Pia (1847-1911), did the Ajuda Palace really become the official residence of the Portuguese Monarchy. Balls and several ceremonies were held in the Palace rooms which became the centre of the Portuguese Court in the 19th century. The Palace was closed after the proclamation of the Republic in 1910 and reopened to the public in 1968, as a Museum. Gathering important collections from the 15th to the 20th century, mainly of decorative arts, the Palace is still used by the Portuguese State for official ceremonies.