The town was inhabited in the prehistoric ages, thanks to its favourable
location. At one time, it was an important river crossing, and part of the
Limes Romanus system named as Avanum during Roman rule. The first written
record of the town is from 1075 under the name Kakath. In the 16th
century, after the Turks conquered Buda in 1541, the town, along with
Esztergom, came under the Ottoman rule. Many attempts to retake the town from
the Turks followed, but they were unsuccessful except 1595–1605 period, until