Dilsberg Castle (German: Bergfeste Dilsberg) is a castle on a hill above the River Neckar in Neckargemünd, Germany. The castle was built by the counts of Lauffen in the 12th century. In the 13th century it became the main castle for the counts. In the 14th century it became part of the Electorate of the Palatinate and received town rights in 1347. During the Thirty Years' War, the castle was considered impregnable until Imperial forces under Tilly took the castle in 1622 after a long siege. In 1799, French forces tried and failed to storm the castle. A 46-metre-deep well helped keep the defenders supplied during this assault. In the 19th century the castle fell into ruin and was used as a quarry. American writer Mark Twain stopped there in the 1870s and wrote about in A Tramp Abroad. Today the castle and its town are a tourist attraction and are administered by the Staatliche Schlösser und Gärten Baden-Württemberg, attracting thousands of visitors.
https://en.wikipedia.org/wiki/Dilsberg_Castle
From Bædeker's Rhine - 1873: Route 31 page 182
Schlierbach is a station halfway to Neckargemünd. Beyond it, on a wooded eminence to the r., rises the castle of Dilsberg, unsuccessfully besieged by Tilly during the Thirty Years' War. It was used as a state-prison down to the beginning of the present century, and the following anecdote shows how rigorous was the confinement to which the prisoners were subjected. On one occasion, when the castle was visited by strangers who were desirous of seeing the cells, they were told by the officer in command that he could not oblige them, as the prisoners were then making a tour in the Odenwald and had taken the keys with them.