The city underwent a period of expansion in the 16th century. The Wall of Vilnius were built for protection between 1503 and 1522, comprising nine city gates and three towers, and Sigismund II Augustus moved his court there in 1544.