Hainburg is thought to have been established around 1050, when emperor Henry III had a castle built on a hill called Schlossberg. The town went through many good and bad times. The Babenbergers, who were involved in the active development of the town, were followed by the Hapsburgs, and with Hapsburgs came centuries when Hainburg was pledged several times and suffered in wars. It was threatened several times by the old Hungarians and Turks. Both world wars also left their mark on Hainburg too. Today, it is an international border town between the West and East, as it has always been.
On 27 October 1996, on the Schlossberg, an agreement was signed on the Donau National Park, which should ensure the protection of a countryside that is unique in Central Europe and also the last of its kind. This floodplain forest, with its richly structured riverbed between Vienna and Bratislava, is the also last of its kind in Austria.