On 2 April 1383, a marriage contract was signed in Salvaterra de Magos betrothing the ten year old Beatrice of Portugal (1373–1420) to the widowed King John I of Castile (1358–1390), which suggests that already in the Middle Ages there was a royal palace in Salvaterra de Magos. However, documentary references about this 'old' palace are not abundant.
In the start of the 16th century, King John III of Portugal (1502–1557) awarded the estate of Salvaterra de Magos to his brother prince Luís of Portugal, Duke of Beja (1506–1555), who constructs (or rebuilds) a new palace with sumptuous gardens. After his death, the palace is inherited by his son António, Prior of Crato (1531–1595), who was king of Portugal for 33 days in 1580, and it becomes part of the Portuguese royal domains and estates. The palace is expanded by King Philipp II in 1590 with help of the architect Filippo Terzi aided by the Portuguese architect Baltazar Álvares, who was also responsible for other royal palaces in Almeirim and Santarém. Further expansion happens under King Peter II (1648–1706), who was fond of hunting, starting in 1690. His renovations give the palace a baroque touch, which still can be seen in the chapel today.
The 18th century was the heyday of the royal palace of Salvaterra de Magos. It was a favored palace, which was visited by the royal family on many occasions, primarily during the winter up to Carnival. They often would come by barge from the Ribeira Palace in Lisbon over the Tagus river to Salvaterra de Magos (the barges used can now be visited in the maritime museum of Lisbon). Also, the palace was further expanded and remodeled. King Joseph I (1714–1777) orders the construction of an opera house. The architect Carlos Mardel assisted with the design. It is inaugurated on 21 January 1753 with the opera ‘Didone Abandota’. In the next 39 years between 1753 and 1792, numerous opera performances were to follow (according to some 64 different shows). Also, Carlos Madel created a new falconry building. Falconry at Salvaterra de Magos had its heyday in 1750s with the arrival of a dozen Dutch falconers from Valkenswaard, who were to instruct the local falconers with the art of Dutch falconry.