Östhammar's city status was granted by king Albert in 1368. During this period a castle called Östhammarshus was built, but already in 1434 the castle was burnt down by its Danishvogt, who fled to Denmark over the sea when faced with the Engelbrekt rebellion. By the late 15th century the post-glacial rebound had made it hard to reach Östhammar by boat and its city status was transferred to Öregrund. In 1539 Östhammar however regained its city status and the city was moved closer to the sea.
In 1651 Östhammar got a town hall, and in 1795 Östhammar was heavily damaged by fire. Between the early 17th century and the middle of the 19th century the fishing of herring played a very important role in Östhammar's economy.