This is the very old mosque in Turkey which dates back to 12th century A D. It was built in the rule of Saljukh Sultan. The fortress and the masjid both have the names of the then ruler of Turkey Ala-ud-din Kayquabad.
The present mosque was built by the then rulers when they took control of the city in 1080 from the then Christian rulers and converted their worship building into the mosque for the Muslims to offer their religious prayers. Most of the foundations of this mosque remain the same which were taken as the base of the building without demolishing them. It may have been considered good enough to bear the load of the new structure.
The architects, with the consultation of the rulers decided to change the main gate to the mosque from the west to the north. The rulers also instructed the architects to build the monument on the side of the northern entrance from where the whole city was visible along with the then current palace of the rulers.
The rulers, with the consultation of the architect, started the construction of the tomb in the courtyard which was completed in later years by the brother of the then ruler. The mosque is 56 meters in length and 71 meters wide.
The mosque could not be completed in one time operation. It was started in the mid-12th century and finally finished in the mid 13th century. Latest development is that the eastern gate is open for people to enter the mosque into the prayer hall. Unfortunately I could not locate the capacity of either the prayer hall or the courtyard of this historical monument of the Turkish Empire.
The mehrab where the Imam stands to lead the prayer is beautifully painted which depicts the tradition and culture of the Seljuk dynasty.