Another Classical domed mosque type is, like the Byzantine church of Sergius and Bacchus, the domed polygon within a square. Octagons and hexagons were common, such as those of Üç Şerefeli Mosque (1437–1447) and Selimiye Mosque in Edirne. The Selimiye Mosque was the first structure built by the Ottomans that had a larger dome than that of the Hagia Sophia. The dome rises above a square bay. Corner semi-domes convert this into an octagon, which muqarnas transition to a circular base. The dome has an average internal diameter of about 31.5 meters, while that of Hagia Sophia averages 31.3 meters. Designed and built by architect Mimar Sinan between 1568 and 1574, when he finished it he was 86 years old, and he considered the mosque his masterpiece.