Ľupča (1263), Komárno (1269), Gelnica (before 1270), Bratislava (1291) and Prešov, Veľký Šariš and Sabinov (all in 1299). The Saxons in Spiš () were granted a collective charter (1271) by King Stephen V of Hungary. The colonisation of the northern parts of the Kingdom of Hungary continued during the period; Walloon, German, Hungarian and Slavic "guests" (hospes, as they are called in contemporary documents) arrived to the scarcely populated lands and settled down there. The contemporary documents mention that settlers from Moravia and Bohemia arrived to the western parts of present-day Slovakia, while on the northern and eastern parts, Polish and Ruthenian "guests" settled down. German guests had an important but not exclusive role in the development of towns. Smaller groups of Germans were present already prior the Mongol invasion, but their immigration took a significant rate in the 13th-14th century. In that time, there already existed settlements with a relatively highly developed economy in the territory of present-day Slovakia, but Germans who came from economically and administrative more advanced regions introduced new forms of production and management, new legal system and culture. The German guests settled in Upper and Lower Spiš, mining towns in Central Slovakia, their wide surroundings and many localities in Western Slovakia: Bratislava, Trnava and wine-growing towns in Malé Karpaty. In the Middle Ages, present-day Slovakia belonged to the most urbanized regions of the Kingdom of Hungary and it was an important cultural and economic base. According to the decree of the King Vladislaus II Jagiello (1498) six of the ten most important towns in the kingdom were located in the present-day Slovakia: Košice, Bratislava, Bardejov, Prešov, Trnava and Levoča. In 1514, more than half of the royal towns and free mining towns of the kingdom were located in Slovakia. At the end of the Middle Ages, about two hundred other settlements had an urban character from a functional point of view. The first written mention prior 1500 is available for 2.476 settlements. The mining towns in Slovakia significantly contributed to the economy of the Kingdom of Hungary. Around the middle of the 14th century, Kremnica alone produced 400 kg of gold per year. Banská Štiavnica and Banská Bystrica produced a substantial proportion of silver of the whole kingdom. During the second half of the 14th century, the Kingdom of Hungary produced cca 25% of Europe's total output. The towns formed unions and associations to defend