Selimiye Mosque (Greek: Τέμενος Σελιμιγιέ Témenos Selimigié; Turkish: Selimiye Camii), historically known as Cathedral of Saint Sophia or Ayasofya Mosque (Turkish: Ayasofya Camii), is a former Christian cathedral converted into a mosque, located in North Nicosia. It has historically been the main mosque on the island of Cyprus. The Selimiye Mosque is housed in the largest and oldest surviving Gothic church in Cyprus (interior dimensions: 66 X 21 m) possibly constructed on the site of an earlier Byzantine church.
 In total, the mosque has a capacity to hold 2500 worshipers with 1,750 m2 (18,800 sq ft) available for worship. It is the largest surviving historical building in Nicosia, and according to sources, it "may have been the largest church built in the Eastern Mediterranean in the millennium between the rise of Islam and the late Ottoman period". It was the coronation church of the kings of Cyprus.
 The name of the cathedral derives from Hagia Sophia, meaning "Holy Wisdom" in Greek. According to Kevork K. Keshishian, the dedication of the cathedral to the Holy Wisdom is a remnant from the Byzantine cathedral, which occupied the same place. However, such a cathedral is absent from Byzantine sources and is not associated with any excavated ruins. In spite of this, there is evidence of the existence of such a cathedral; an 11th-century manuscript mentions the existence of an episcopal church dedicated to Holy Wisdom in the city.
 It is not certain when the construction of the cathedral began, it may have gradually replaced its Greek predecessor or may have been built alongside it. The date cited for the laying of the foundation stone is 1209, and the Latin archbishop of Nicosia responsible for this is named in various sources as Thierry or Albert. There are claims of evidence indicating an earlier beginning date, and even the Knights Templar may have made some effort for the construction of a new cathedral during their rule in 1191–92. Under the early years of the reign of Archbishop Eustorge de Montaigu (reigned between 1217 and 1250), the construction is thought to have accelerated. By 1228, the church was "largely completed" under Eustorge. Although it is held in some sources that the arrival of Louis IX of France in Cyprus in 1248 for the Seventh Crusade gave a boost to the construction, there is no evidence to support this claim. By the end of the 13th century the side aisles and a large part of the middle aisle were completed.
 During the 13th and 14th centuries, the cathedral was damaged twice by earthquakes, in 1267 and 1303. The 1267 earthquake caused significant delay in the construction of the nave. Archbishop Giovanni del Conte, oversaw the completion of the nave and the narthex until 1319 and that of the middle aisle, the buttresses of the chevet, the façade and a chapel/baptistery from 1319 to 1326. He also initiated the adornment of the cathedral with frescoes, sculptures, marble screens and wall paintings. In 1326, the cathedral was finally consecrated and officially inaugurated with a great celebration.
 During the Lusignan rule, the cathedral served as the coronation church of the Kings of Cyprus. After the Genoese conquest of Famagusta, it also became the coronation church of the Lusignan Kings of Jerusalem, and finally, the Lusignan Kings of Armenia. It also housed the Trials of the Knights Templar in 1310.
 Even though the cathedral was inaugurated, the building was still incomplete and in 1347 Pope Clement IV issued a papal bull for the cathedral to be completed and renovated since it had been affected by an earthquake. The bull gave a 100-day period of indulgence for those who participated in the completion of the cathedral, however, this effort did not achieve its aim. The portico and the northwest tower were constructed at this time and the three gates of the western wall were embellished with structures. Kings, prophets, apostles and bishops were depicted at the reliefs in three arches.
 In 1359, the Papal legate in Cyprus, Peter Thomas, assembled all Greek Orthodox bishops of Cyprus in the cathedral, locked them in and began preaching in order to convert them. The sound of shouting coming from the cathedral gathered a large crowd outside the cathedral, which soon began a riot to free the priests and burned the doors of the cathedral. The king ordered the rescue of the preacher, who would later be reprimanded, from the mob, and the freeing of the bishops.
 In 1373, the cathedral suffered damage during the Genoese raids on Cyprus.
 The 1491 Cyprus earthquake severely damaged the cathedral. A visiting pilgrim described that a large part of the choir fell, the chapel of sacraments behind the choir was destroyed and a tomb that purportedly belonged to Hugh III of Cyprus was damaged, revealing his intact body in royal clothing and golden relics. The golden treasure was taken by the Venetians. The Venetian Senate ordered the repair of the damage and set up a special commission, which taxed an annual contribution of 250 ducats from the archbishop. The repair was very extensive and thorough; in 1507, Pierre Mésenge wrote that despite the fact that the building was "totally demolished" 20 or 22 years ago, it then looked very beautiful.
 When the Venetians built their walls of Nicosia, St. Sophia's Cathedral became the center of the city. This reflected the position of medieval European cathedrals, around which the city was shaped.
 During the 50-day Ottoman siege of the city in 1570, the cathedral provided refuge for a great number of people. When the city fell on 9 September, Francesco Contarini, the bishop of Paphos, delivered the last Christian sermon in the building, in which he asked for divine help and exhorted the people. The cathedral was stormed by Ottoman soldiers, who broke the door and killed the bishop along with others. They smashed or threw out Christian items, such as furniture and ornaments in the cathedral and destroyed the choir as well as the nave. Then, they washed the interior of the mosque to make it ready for the first Friday prayer that it would host on 15 September, which was attended by the commander Lala Mustafa Pasha and saw the official conversion of the cathedral into a mosque. During the same year, the two minarets were added, as well as Islamic features such as the mihrab and the minbar.
 The first imam of the mosque was Moravizade Ahmet Efendi, who hailed from the Morea province of the Ottoman Empire. All imams maintained the tradition of climbing the stairs to the minbar before Friday sermons while leaning on a sword used during the conquest of Nicosia to signify that Nicosia was captured by conquest.
 Following its conversion, the mosque became the property of the Sultan Selim Foundation, which was responsible for maintaining it. Other donors formed a number of foundations to help with the maintenance. Okçuzade Mehmed Paşa, a governor of Cyprus in the 16th century, donated a shop to provide income for the Sultan Selim Foundation; other donations include estates in the countryside and other shops. The foundation employed trustees (mütevelli) to look after the funds and transferred 40,000 akçe annually to Medina in late 16th century. During the Ottoman period, it was the largest mosque in the whole island, and was used weekly by the Ottoman governor, administrators and elite for the Friday prayers. In the late 18th century, a large procession that consisted of the leading officials in the front on horseback, followed by lower-ranking officials on foot, came to the mosque every Friday.
 The Friday prayers also attracted a large number of Muslims from Nicosia and surrounding villages. Due to the crowds frequenting the mosque, a market developed next to it and the area became a trade center. The area around the mosque became a center of education as well, with madrasahs such as the Great Madrasah and Little Madrasah being built nearby.
 In 1874, upon rumours that Sultan Abdülaziz would visit Nicosia, a new gate, called the "Aziziye Gate" after the sultan, was built at the east end of the building. The gate was an enlargement of a pre-existing Lusignan window on the site, and pieces of marble and other material from the surroundings were used in its construction. The decorations of the gate include an inscription by calligrapher Es-Seyyid Ahmet Şukri Efendi, the calligraphy teacher of the local high school. The inscription consists of a praise of the sultan and mentions that the gate was built on Abdülaziz's orders by Nazif Pasha. It is surrounded by two ornate figures depicting cypress trees. The gate was afterwards used as the women's entrance, and later fell into disuse, remaining permanently locked.
 In 1949, the mu'addhins stopped climbing to the minaret to read the adhan and started using loudspeakers instead. On 13 August 1954, the Mufti of Cyprus officially renamed the mosque "Selimiye Mosque", in honour of the Ottoman sultan Selim II, who headed the empire during the conquest of Cyprus.
 The choir has a surrounding ambulatory, but no apse chapels. This follows the plan of Notre Dame de Paris, which had in turn influenced a number of other cathedrals, including Notre Dame de Mantes at Archbishop Thierry's hometown. The transepts consist of chapels that have the same height as that of the aisles, and are attached to the second bays to the west of the ambulatory. This follows the plan of the Poitiers Cathedral, which is the episcopal church of the French town of Lusignan, the hometown of the House of Lusignan. The north and south entrances had initially been in the fourth bay of the nave, although the Ottoman-built Aziziye Gate is at the eastern end of the cathedral. The initial arrangement is thought to have been modelled after Sens Cathedral.
 (burials there when it was still a church)