A Latgalian hill fort is known to have existed at Rēzekne from the 9th to the 13th centuries, until its destruction at the hands of German crusaders of the Livonian Order. In 1285, the knights built a stone fortress on the site, which is today known as Rēzekne castle ruins, to serve as a border post on their eastern frontier.