The Selcuk castle is situated on a hill to the north of the church. It is a Byzantine structure, repaired during the Aydinogullari Emirate, which displays building techniques of various periods. The perimeter measures nearly 1.5 km. There are fifteen towers and a mosque dating from the 14th Century.
The main entrance gate of the castle was constructed from the stones of Roman buildings in the 6th century AD. The Selcuk castle has 15 towers and is surrounded by rubble stoned city walls reaching to 1.5 km. A church, built into a former Byzantine church, a small mosque and several cisterns are within the borders of the citadel of Ayasuluk. Also, it was proved from the remaining of sub-mycenean graves belonging to 14th century BC, that the hill was used as a necropolis.
From the 7th to the 9th century, the city of Ephesus was divided between the harbor town and the citadel on the hill, a mile away. Both were designed for defense against constant attacks by Arabs and pirates. The walls around St. John’s Basilica were reinforced, using marble blocks from the previous site of Ephesus. The combination of the marble facade and the mortared rubble made the walls 4m thick. The citadel walls are 1.5 km around with 15 towers of the castle. Entry to the castle from the south is through the Gate of Persecution, which leads into the Basilica. The gate used to have a frieze of Odysseus discovering Achilles, and when it was mistakenly thought to depict the persecution of Christians, the gate acquired its name. In the 8th century the square towers on either side of the gate were made pentagonal, aiding in their defensive capabilities.
The location of Ephesus changed over the years, for various reasons, including the changing course of the Cayster River as well as the need to defend itself against invasions. The history of Ephesus is a fascinating one, as it had great religious and military importance to many different people throughout the changing of empires. Selcuk is the present-day name for Ephesus, and the history of the castle is closely tied to that of the city. As the Selcuk castle was located at significant point it was rebuilt and expanded in the Selcuk and Ottoman eras.