The Hainburg Castle stands at the Schlossberg Hill (291 meters above the sea level).
Emperor Henry III commissioned the erection of a fortress on the Castle Hill (Schlossberg) in 1050. Under Duke Leopold V the enlargment of the fortress started in 1194. Boundaries of the town were extended as far as the Danube River.
In February 11, 1252, Ottokar II, later the King of Bohemia, married at the castle the last Babenberger Margaret of Austria.
In Battle of Dürnkrut in 1278 Ottokar II, Premysl lost the castle to the Habsburgs.
After 1629, the castle belonged to the city.
In July 11, 1683, the Second Ottoman Campaign destroyed the city along with the castle. About 8000 people were killed or deported by the Turks.
On the 27th October 1996, on the Schlossberg, an agreement was signed on the Donau-Auen National Park, which should ensure the protection of all countryside that is unique in Central Europe and also the last of its kind.