Esztergom is a city with county rights in northern Hungary, 46 km northwest of the capital Budapest. It lies in Komárom-Esztergom County, on the right bank of the river Danube, which forms the border with Slovakia there. Esztergom was the capital of Hungary from the 10th until the mid-13th century when King Béla IV of Hungary moved the royal seat to Buda.