The history of Copenhagen dates back to the first settlement at the site in the 11th century. From the middle of the 12th century it grew in importance after coming into the possession of Bishop Absalon, and the city was fortified with a stone wall during the 13th century. The harbour and the excellent possibilities for herring fishing contributed to Copenhagen's growth and development into an important trading centre. It was repeatedly attacked by the Hanseatic League as the Germans became aware of its expansion. In 1254, it received its charter as a city under Bishop Jakob Erlandsen.