The Magyars occupied the town around 900 and fortified the abandoned Roman fortress. Stephen I, the first king of Hungary, founded an episcopate there. The town received its Hungarian name "Győr". The Hungarians lived in tents, later in cottages, in what is now the southeastern part of the city centre. The town was affected by all the trials and tribulations of the history of Hungary: it was occupied by Mongols during the Mongol invasion (1241–1242) and then was destroyed by the Czech army in 1271.