In 1487, the city was fortified with an outer wall 10 km (6.2 mi) in circumference by Mahmud Begada, the grandson of Sultan. The fortification consisted of twelve gates, 189 bastions and over 6,000 battlements.