By 1839, the palace was once again used to hold royal balls, and served as the temporary residence for visiting royal dignitaries. In 1840, during extensive renovations of the Palace of Necessidades, the royal family returned to Belém and resided in the palace during that decade. The Infanta Antónia was born there in 1845. By 1850, renovation of the grand ballroom was complete, permitting Queen Maria II to receive Portuguese society, and in September 1861, the Infanta was married there to Prince Leopold of Hohenzollern. In November 1861, the Infante Augusto died, followed by the Infante João on Christmas. A succession of deaths forced the Royal Family to abandon the palace, and it once again became a residence for visiting dignitaries. This change in purpose was accompanied by small repairs to the building, as well as the installation of gas lines and new lighting.