Being a free city, Sélestat attracted settlers from the region who sought protection, freedom and a thriving economic environment. The first city wall, which had become too constricting, was replaced in 1280, and a third wall had to be erected in the 16th century as the city grew. At the end of the Middle Ages, the population was estimated at between 5,000 and 6,000. It was then the fourth largest Alsatian town after Strasbourg (18,000), Colmar and Haguenau (6,000 each). The local economy reached its zenith around 1500. It was centered on shipping and trade (mainly hay, cereals, wine, fish, glass, iron and salt). As the road network was poor and dangerous, goods transited via the Ill river.