Levoča is located in the historical region of Spiš (formerly Szepes), which was inhabited as early as the Stone Age. In the 11th century, this region was conquered and, subsequently, became part of the Kingdom of Hungary and remained such until 1918. After the Mongol invasions of 1241/1242, the area was also settled by Germans. The town became the capital of the Association of Spiš Germans, with a form of self-rule within the Kingdom of Hungary. The oldest written reference to the city of Levoča dates back to 1249. In 1317, Levoča (at that time generally known by the German name of Leutschau - see Chronology below for lists of changing names) received the status of a royal town. In 1321 a wide storing right was granted enticing merchants, craftsmen and mine owners to settle in this town.

In the 15th century the town, located on an intersection of trade routes between Poland and Hungary, became a rich center of commerce. It exported iron, copper, furs, leather, corn, and wine. At the same time the town became an important cultural centre. The English humanist Leonard Cox taught around 1520 in a school in Levoča. The bookseller Brewer from Wittenberg transformed his bookstore in a prolific printing plant, that lasted for 150 years. Finally, one of the best-known medieval woodcarvers Master Paul of Levoča settled here.

The town kept this cultural and economic status until the end of 16th century, in spite of two damaging fires : the first in 1550 destroyed nearly all of the Gothic architecture and another in 1599. In this period of prosperity several churches were built and the town had a school, library, pharmacy, and physicians. There was a printing press as early as 1624. Levoča was a center of the Protestant Reformation in Northern Hungary. The town started to decline during the anti-Habsburg uprisings in the 17th century.

In a lurid sequence of events in 1700, the mayor of the town was accidentally wounded by a local nobleman during a hunt, generating a series of revenge attacks, finally resulting in the murder of the mayor, Karol Kramler, a Saxon magistrate. The mayor's arm was then cut off, embalmed, and preserved in the town hall as a call to further revenge. This became the subject of a Hungarian novel about the town, The Black City, by the writer Kálmán Mikszáth.[2]

On July 3, 1995 Levoča was visited by Pope John Paul II. He celebrated a mass for 650,000 celebrants at the traditional pilgrim site of Mariánska hora, a hill about 2 kilometres (1 mile) north of Levoča with a spectacular view of the town.

Levoča lies at an altitude of 570 metres (1,870 feet) above sea level and covers an area of 64.042 square kilometres (24.727 sq mi).[3] It is located in the northern part of the Hornád Basin at the foothills of the Levoča Hills, at the stream Levočský potok, a tributary of Hornád. Poprad is 25 kilometres (16 miles) away to the west, Prešov 50 km (31 miles) to the east, Košice 90 km (56 miles) to the southeast and Bratislava 370 km (230 mi) to the southwest.

The old town is picturesquely sited and still surrounded by most of its ancient walls. In associating the town with Spiš Castle and Žehra in June 2009 as the renamed World Heritage Site of "Levoča, Spišský Hrad, and the Associated Cultural Monuments", UNESCO cites the town's historic center, its fortifications, and the works of Master Paul of Levoča preserved in the town.

The main entrance to the old town is via the monumental Košice Gate (15th century) behind which is located the ornate baroque Church of the Holy Spirit and the New Minorite Monastery (c. 1750).

The town square (Námestie Majstra Pavla - Master Paul’s Square) boasts three major monuments; the quaint Old Town Hall (15th-17th century) which now contains a museum, the domed Evangelical Lutheran Church (1837) and the 14th century Roman Catholic Church of St. James (in Slovak: Chrám svätého Jakuba, often mistakenly referred to in English as St. Jacob's). It houses a magnificently carved and painted wooden Gothicaltar, the largest in Europe, (18.62 m (61.09 ft) in height), created by Master Paul around 1520. The square is very well preserved (despite one or two modern incursions) and contains a number of striking buildings which were the townhouses of the local nobility in the late Middle Ages. Also notable in the square is the wrought iron "Cage of Shame", dating back to the 17th century, used for public punishment of miscreants. A plaque on one of the houses records the printing and publication in the town of the most famous work of Comenius, the Orbis Pictus. Other buildings on the square house a historical museum and a museum dedicated to the work of Master Paul.

Behind the square on Kláštorská Street are the 14th-century church and remains of the old monastery of the Minorites, now incorporated into a Church grammar school. Nearby is the town's Polish Gate, a Gothic construction of the 15th century.

From the 16th century to the end of 1922, Levoca was the administrative center of the province of Szepes (Spiš). Between 1806 - 1826, the Hungarian architect from Eger Antal Povolny built a grandiose administration building, the Large Provincial House, as the seat of the town's administration. He adjusted its Classicist style to Levoca's Renaissance character by emphasizing the building's horizontal lines. The House is considered the most beautiful Provincial House in the former Kingdom of Hungary. Today, it is reconstructed and it is a seat of the administration.

The State Regional Archives (Štátny oblastný archív) are in a tan stone building on the north side of the square at nám. Majstra Pavla 60.