the Slavs in 623, establishing the first known Slavic political entity, Samo's Empire, which lasted until 658. From the 8th century until 907 the Pressburg fortress as well as the Dowina (Devín) Castle are important centres of the Principality of Nitra. In 864 the first written reference to the Devín Castle (Dowina) appears in the Fuldish Annals. Around 900 it was probably owned by the (originally) Lower Pannonian prince Braslav (Bräslav, Brazlaw) - or by a magnate of the same name - who was a vassal of Bavaria (Germany). Earlier, it was thought that Bräslav was the person who gave the town Bratislava its German name Brezalauspurc (see 907), later Pressburg, and maybe also its new Slovak name Bratislava; nowadays, it is assumed that Pressburg/Brezalauspurc is a distortion of Predeslausburg, a name derived from Predslav, who was (according to some historians) the ruler of Bratislava around 900 and the 3rd son of the Great Moravian king Svätopluk; 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 were totally defeated by the Magyars; as a result, the Frankish East March dissolved and was occupied by the Magyars (907–955). Pressburg then became part of emerging medieval Hungary. 1000–1241 From 1000 to the early 13th century a market settlement (the future town centre) grew below the Pozsony Castle (first written reference in 1151) and became an important centre in the early 13th century. Further settlements in the surrounding areas followed. The Castle became one of the best fortifications in Hungary because of its position, and (along with the city) became a site of frequent attacks and battles, and a place of frequent stay by Hungarian kings. Around 1000 the Pozsony county (comitatus), one of the first counties in Hungary, was founded, probably by Grand Prince Stephen I. Coins with the inscriptions "PHANUS REX" and "RESLAVVA CIV" have been found in Sweden; some scholars claim that the coins were minted in "(p)RESLAVVA CIV(itas)" or "(b)RESLAVVA CIV(itas)" (i.e., in the town of Bratislava), but other authors point out that no coins of this type have been found on the territory of the Kingdom of Hungary, their weight and diameter differ from King Stephen's other coins and their inscriptions are confused which suggest that they