 Queen Elisabeth Farnese was widowed in 1746, her husband King Philip V being succeeded by Ferdinand VI, her step-son.As such, to ensure that Elisabeth would remain away from the court, King Ferdinand VI agreed to the construction of a palace at Riofrío for her own disposal.During the reign of her step-son, the queen resided at the Royal Palace of La Granja de San Ildefonso.