Werfen is a market town in the St. Johann im Pongau District, in the Austrian state of Salzburg. The municipality comprises the cadstral communities (Katastralgemeinden) of Reitsam, Scharten, Sulzau and Wimm. It is mainly known for medieval Hohenwerfen Castle and the Eisriesenwelt ice cave, the largest in the World.
Werfen is located in the northwest of the historic Pongau region, on the southern rim of the Berchtesgaden Alps (east of Mt. Hochkönig) and the Tennengebirge. It is situated in the valley of the Salzach River, about 40 km (25 mi) south of the city of Salzburg. The Salzburg-Tyrol Railway line (Giselabahn) and the Tauern Autobahn run parallel to the river.
The settlement, one of the oldest markets in the former Archbishopric of Salzburg, arose south of the Burg Hohenwerfen, erected from 1075 at the behest of the Archbishop Gebhard during the Investiture Controversy with Emperor Henry IV. As the seat of a local administrator, Werfen and the castle were heavily attacked during the German Peasants' War in 1525/26. It was also a centre of the expulsion of Protestant citizens under the rule of Archbishop Count Leopold Anton von Firmian in 1731. With the lands of the former archbishopric, Werfen finally fell to the Austrian Empire after the Vienna Congress in 1816.