The town was first mentioned in 1329. The Teutonic Knights built a wooden outpost by a forest near the Prussian village of Rast, and they called it Rastenburg. It was most probably situated on a hill overlooking the Guber River, in the same place where half a century later the fortified St. George’s Church was erected. The Church still stands today. This outpost and the people who manned it were to defend this part of the monastic state from the many Lithuanian invasions; it was also a meeting point for crusading armies heading for Lithuania. The outpost was conquered and burned to the ground by Lithuanian forces twice (on November 3rd, 1345 by the army of Prince Olgierd and Kiejstut, and on February 22nd, 1347), yet it was rebuilt each time. The number of dwellers in the nearby village began to grow. On November 11th, 1357, the Balga Commander, Johan Schindekopf, granted location privileges based on the Chełmno law. It was probably then that the construction of a stone castle began; it was situated at the south-eastern corner of the town walls. In the 15th century, the people of Rastenburg rebelled against the monastic rule on several occasions. In 1410 the Knight Johart and the Mayor Barddyne surrendered the town to the King of Poland. In 1440 Rastenburg was one of the founders of the Prussian Union. In 1454 rebellious townsmen took the castle, and the Teutonic Procurator, Wolfgang Sauer, was drowned in the mill pond. After the Order was secularised in 1525, the town’s century of greatness began. It ended due to many epidemics (in 1625 2,500 people died in and around the town as a result of the epidemics) and due to the outbreak of the 1st Polish-Swedish war. Subsequent wars and epidemics led to the fall of the town. Rastenburg had to wait until the mid-19th century for a new chapter in its development. The town gained a railway connection with larger towns in the Province, at a time when many new industrial estates and public institutions were being founded. The next crisis was brought about by the outbreak of the World War 1, and lasted until the 1930s. At the end of January 1945, after the town was occupied by the Russian army, the castle and most of the old town were burned down.

There is a legend connected with the history behind the coat of arms of Kętrzyn:
A bear lived in the local forest and was a nuisance to the inhabitants, even causing damage near the town. No wonder the inhabitants decided to kill this dangerous beast. They organised a hunt and wounded the bear during the chase. However, the wound was not fatal and the bear ran and hid in some thick woods. However, it lacked enough strength to get out and it was killed there.
German maps mark a hill near Zalesie Kętrzyńskie as being the site of this killing.