Sopron (ˈʃopron; Ödenburg, ˈøːdn̩ˌbʊʁk is a city in Hungary on the Austrian border, near Lake Neusiedl/Lake Fertő.
When the area that is today Western Hungary was a province of the Roman Empire, a city called Scarbantia stood here. Its forum was located where the main square of Sopron can be found today.
During the Migration Period, Scarbantia was believed to be deserted. When Hungarians arrived in the area, the city was in ruins. From the 9th to the 11th centuries, Hungarians strengthened the old Roman city walls and built a castle. The city was named in Hungarian after a castle steward named Suprun. In 1153, it was mentioned as an important city.
In 1273, King Otakar II of Bohemia occupied the castle. Even though he took the children of Sopron's nobility with him as hostages, the city opened its gates when the armies of King Ladislaus IV of Hungary arrived. Ladislaus rewarded Sopron by elevating it to the rank of free royal town.
During the Ottoman occupation of Hungary, the Ottoman Turks ravaged the city in 1529, but did not occupy it. Many Hungarians fled from the occupied areas to Sopron, and the city's importance grew.
While the Ottomans occupied most of Central Europe, the region north of Lake Balaton remained in the Kingdom of Hungary (1538–1867) (captaincy between Balaton and Drava).
In 1676, Sopron was destroyed by a fire. The modern city was born over the next few decades, when Baroque buildings were built to replace the destroyed medieval ones. Sopron became the seat of the comitatus Sopron.
The town was the seat of the Ödenburg comitat near 1850. After the compromise of 1867 and until 1918, the city (known with the dual bilingual name of
Sopron - Ödenburg) was part of the Habsburg-ruled Kingdom of Hungary.
Following the breakup of the Austro-Hungarian Empire, ethnic Germans inhabited parts of four western Hungarian counties: Pozsony (Pressburg in German; Bratislava in Czech/Slovak), Vas (Eisenburg), Sopron (Ödenburg) and Moson (Wieselburg).