King Lewis the Bavarian erected Pfalzgrafenstein Castle from 1326/27 as a customs toll castle on a rock in the Rhine.