In 864 the first written reference to the Devín Castle (Dowina) appears in the Fuldish Annals. It is known that the name came from one of King Saint Stephen's great commander Poson, Pressburg was its German name and Presporok its Slovak. The modern Slovak name Bratislava, however, is assumed to be derived (by mistake) from the name of the Czech ruler Bretislav I. The first written reference to Bratislava (as Brezalauspurc) appears in 1837 by J. Safarik Slovak historian. The Bavarians are totally defeated by the Magyars; as a result, the Frankish East March ceases and is occupied by the Magyars (907–955). The town is now part of emerging medieval Hungary.