Sorgenfri Palace was built by the architect Francois Dieussart in 1705-06 for Carl Count Ahlefeldt. From 1730, this country house was owned by the royal family, and Crown Prince Frederik (V) had court architect Lauritz de Thurah build a wing for the gentlemen of the Court and a horse stable.
When Frederik V became king, the palace was given to his aunt, grand duchess Sophie Caroline of East Friesland, who let de Thurah demolish the main building in 1756-57 and build a new palace. From 1791-94, the heir apparent, Frederik (VI), expanded and modernised the palace.