According to the legend, while the sultan was inspecting his troops, he stopped to take a rest on a small hill from which it had an excellent view on the Danube and the Hungarian lands across the river. He fell asleep on "ihram" (carpet) and felt rejuvenated when he woke up, so he ordered for the fortress to be built on this spot. This also gave the original, Turkish name of the fortress, the Ihram Fortress. The fortress was especially built for the elite Ottoman units and the heavy artillery. Apart from defensive role against the Hungarians, it also controlled the traffic on the Danube and served as the starting point in Turkish excursions in the northern areas, and the occupation in 1521.