The history of the city dates back to a 12th-century Slavic settlement. The area belonged to the Czech (Bohemian) Duchy (and later Kingdom) from the 11th century. It was first mentioned under the Latinized name "Sitavia" in 1238. It was granted town rights in 1255 by King Ottokar II of Bohemia, who also built defensive walls. In 1319 it passed to the Piast-ruled Duchy of Jawor of then-fragmented Poland, and after the death of Duke Henry I of Jawor in 1346, it became part of the Czech (Bohemian) Crown again. The city's coat of arms still shows a Czech Lion and a Silesian Piast Eagle. In 1346 the city became one of the members of the Six-City League of Upper Lusatia. At that time the city was granted a special title—it was called "Die Reiche" ("the Rich") because of its high proportion of well-to-do citizens. In 1359 and 1422 it suffered great fires. In 1469, together with the Lusatian League, the city recognized Hungarian King Matthias Corvinus as rightful ruler, thus passing to Hungary, and after his death in 1490 the city returned to the Bohemian Crown, then under the rule of Polish prince Vladislaus II. It remained part of it until 1635 when it passed to the Electorate of Saxony.