Political affiliation of the territory in the 10th and the early 11th century is unclearthe influence of Hungarian Árpáds, Czech Přemyslids and Polish Piasts is being considered. Finally, Nitra became an integral part of the Kingdom of Hungary and the seat of several Árpáds princes. The town survived the invasion of Mongols in 1241. In 1248, Béla IV gave Nitra the privileges of a free royal town. In 1271–1272, Nitra was heavily damaged by the Czech king Ottakar II. The raids also damaged the bishop's property and therefore, as compensation, Nitra was put under his administration in 1288. The town lost its royal privileges and in the next centuries it was unable to recover mainly because of frequent military conflicts.