[1] In the Middle Ages a royal estate, known today as Föresäng [sv], existed in an area of Uppsala called Islandet.
Uppsala Castle was built during the reign of Gustav I Vasa, a period when Sweden was becoming a great power in Europe.
Following a peasant uprising against Vasa's rule, known as the Dacke War, it was decided to build new defensive castles in the kingdom, including one in Uppsala.
The newly constructed complex included royal apartments in the south-west corner, and two large bastions on the western side.
Soon after completion of the new castle, an addition to the east of the royal apartments was constructed, adding "representation premises" such as a hall of state and church.
[3] The Styrbiskop (Bishop-Controller) battery was permanently trained on Uppsala cathedral owing to the hostility between the church authorities and the king from the beginning of his reign.
In 1572, while John III was king of Sweden, a fire ripped through the castle heavily damaging both the original royal apartments and the representation addition.
The castle's church constructed during this period included large multi-story stucco reredos encompassing the entire wall behind the altar.
[3] In 1630, King Gustavus Adolphus announced the decision that Sweden would participate in the Thirty Years' War at the castle.
[3] The repairs were initiated by Duke Adolf Frederick, who in 1743 had been elected heir to the throne of Sweden and needed a proper residence.
The western part of the south wing (above King Jan's Portal), which had contained the royal apartments was not rebuilt.
Hårleman's plans were only partially realized, as in 1751 Adolf Frederick was crowned king and moved into Drottningholm Palace.
It was moved from the south east tower after the fire to its present position on the battlements of the Bishopcontroller (Styrbiskop) gun battery pointed by Gustav Vasa at the cathedral opposite.
In 1903 the government of Sweden opened a regional archive in the castle, containing important historical and genealogical records for Uppsala and surrounding counties.