The Latgalian inhabitants of the settlement were conquered by the German crusaders of the Livonian Order in 1224. They built in 1284 a wooden castle named Marienburg (after Mary, the mother of Jesus) on a nearby island, which served to protect trade routes from Riga to Pskov. The town which developed near the castle also became known as Marienburg. In 1342 new castle from stone was built on the largest isle of Lake Alūksne.
