The economic importance of the town was further diminished in 1871 when the important new Košice–Bohumín Railway was built just 8 kilometers to the south, bypassing Levoča and going through the nearby town of Spišská Nová Ves.