After Gustav Vasa's siege of Stockholm, he restored the privileges of the city which was beneficiary to the burghers of the city. The king maintained his control over the city by controlling the elections of aldermen and magistrates. By the mid-century, the numbers of officials increased in order to make the management of the city more professional and to ensure the state-controlled trade. Stockholm thus lost much of the independence it had had during the Middle Ages and became politically and financially bound to the state. During the reign of his sons (1561–1611), the city council remained escorted by a royal representative and both magistrates and aldermen were appointed by the king.