During the Ottoman occupation of Hungary, Érd was captured by the Turks in 1543, after the castle of Székesfehérvár fell. The Turks built a motte castle and a mosque here. In these times, the place was called Hamzsabég (Hamzabey).