 The settlement was re-fortified again from 1234 by the Teutonic Order; the erection of the castle with the help of stone as building material was begun with around the middle of the 13th century.Under the protection of the castle the settlement gradually begun to develop to a town.In 1277 both "the castle and the town" were besieged heavily by the Yotvingians.