The first written record is, though, of the end of the 12th century – the Czech prince granted the "market town" of Kadaň to the Knights of St. John. Slavic rulers called German settlers into the country, offering them freedom but gaining taxes at the same time. The Knights Hospitaller built the first church in Kadaň – St. John the Baptist – which still stands in the part of town called Hospitaller Suburb, but is now in the Baroque style. In the 13th century, the town was promoted to a "Royal Town". It began to thrive and a new town was built on the heights above the river, with a castle and Franciscan monastery. There was a big fire in 1362. However, Emperor Charles IV who twice visited the town (1367 and 1374) granted it several municipal rights (home rule, a vineyard, and an annual market) that made it flourish again. The reign of Wenceslaus IV produced the skilled clockmaker Mikuláš of Kadaň, who, together with mathematician and astronomer Jan Šindel, designed the Prague Orloj.