The first building on this site was a fortress with a core tower built in the 13th century by Birger Jarl to defend Lake Mlaren. The fortress grew to a palace, named Tre Kronor ("Three Crowns") after the core towers' spire.
In the late 16th century, much work was done to transform the old fortress into a Renaissance-style palace under King John III. In 1690, it was decided to rebuild the palace in Baroque style after a design by Nicodemus Tessin the Younger. In 1692, work began on the northern row. It was complete in 1697, but much of the palace was destroyed in a fire on May 7, 1697.
Tessin rebuilt the damaged palace, and work continued for another 63 years. Half-round wings around the outer western courtyard were finished in 1734, the palace church was finished in the 1740s, and the exterior was finished in 1754. The royal family moved to the palace with the southwest, southeast, and northeast wings finished. The northwest wing was finished in 1760. In the north, the Lejonbacken ("Lion's Slope") was rebuilt from 1824 to 1830. Its name comes from the Medici lions-inspired sculptures that stand there.
The palace is guarded by the Hgvakten, a royal guard of members of the Swedish Armed Forces. The guard dates back to the early 16th century.