The present city was built upon a former Slavic settlement. After the Hungarian conquest of the Carpathian Basin it was incorporated in the Zólyom county of the Kingdom of Hungary. The first known stone church was built by Saxon immigrants in the then still independent settlement of Sásová in the first half of the 13th century, when the area belong to the king. According to Slovak archaeologists Banská Bystrica started as a permanent settlement in the 9th century. Other sources claim that due to the attack of Mongols, in 1243–44, the town ceased to exist. In 1255 King Béla IV granted Banská Bystrica extensive municipal privileges, in order to attract more skilled settlers. Descendants of the German immigrants to this and other counties became later known as the Carpathian Germans. The city flourished as a regional mining center. It built the Late Romanesque Church of the Virgin Mary in the second half of the 13th century. During the same period, Banská Bystrica obtained its own coat of arms inspired by the coat of arms of the ruling dynasty of the Árpáds, also used as the historical flag of the Kingdom of Hungary. The local craftsmen were organized in fifty guilds, with the butchers' guild being the oldest.