The Marksburg is a fortress above the town of Braubach in Rhineland-Palatinate, Germany. It is the only medieval castle of the Middle Rhine that has never been destroyed. It is one of the principal sites of the UNESCO World Heritage Rhine Gorge. The fortress was used for protection rather than as a residence for royal families.
The castle was built to protect the town of Braubach and to reinforce the customs facilities. It was built about 1117 and explicitly first mentioned in 1231. In 1283 Count Eberhard of Katzenelnbogen bought it and through the 14th and 15th century the high noble Counts rebuilt the castle constantly. 1479 the territories of the Count of Katzenelnbogen went to the Count of Hessen.
In the Napoleon period the castle was used as a prison. 1815 it belonged to the Duchy of Nassau. After the Austro-Prussian War 1866 the Duchy of Nassau became a territory of Prussia.