Szepesség (Slovak: Spiš; Latin: Scepusium, Polish: Spisz, German: Zips) was an administrative county of the Kingdom of Hungary, called Scepusium before the late 19th century. Its territory today lies in northeastern Slovakia, with a very small area in southeastern Poland.
The German settlers had been invited to the territory from the mid-12th century onwards. The major immigration came following the devastating Mongol invasion of 1242, which turned Szepes, like other parts of the Kingdom of Hungary, into a largely depopulated area (some 50% of the population was lost).
King Béla IV of Hungary invited Germans to colonize the Szepes and other regions (covering parts of present-day Slovakia, present-day Hungary, and Transylvania). The settlers were mostly traders and miners. The settlements founded by them in the southern parts (Szepesség) were mainly mining settlements (later towns). Consequently, until World War II, Spiš had a large German population (see Carpathian Germans). From 1370 the 41 settlements of the territory subscribed to a uniform special Szepes law system (called Zipser Willkür in German). The last wave of Germans arrived in the 15th century. Later, the number of settlements was reduced to 24 towns.
The Province of 24 Szepes towns was dissolved in 1412, when, by the Treaty of Lubowla King Sigismund of Luxembourg, ruler of Hungary, pawned 13 of the towns of the former Province, as well as the territory around the Ólubló (present-day Stará Ľubovňa) (i.e. the royal domain Lubló, plus Gnézda and Podolin, and several villages) to Poland, in exchange for the amount of 37,000 Czech sixty-groschen coins, that is, approximately 7 tonnes of pure silver. This was to finance his war against the Republic of Venice. The pledged towns were to be returned to the Kingdom of Hungary as soon as the loan was repaid; nobody expected the pledge would take 360 years to redeem (from 1412 to 1772).
In the 16-17th centuries, these cities were mainly populated by Germans. Yet, there lived Hungarian border-guards as well, their region was called ‘Sedes X lanceatorum’ (county of the ten lance-bearers). Until the end of the 17th century, the area was often disrupted by wars, uprisings against the Habsburgs.