Hagia Sophia had been one of the most important Orthodox churches for centuries before it was one of the most important mosques. Now, it is one of the most significant museums of Istanbul.
What made Hagia Sophia so famous among Muslim lands was its dome. Even dough the dome is a very important Islamic architectural element, Hagia Sophia's dome had the longest radius compared to every single mosque that existed until the construction of the Selimiye Mosque in Edirne, Turkey.
The building has a complicated history. It was demolished and rebuilt multiple times. But none of the versions used steel, thus the 4 huge support columns. When the dome is spectacularly huge and there is no steel to support it, the building starts to collapse on itself.
After the conquest of Istanbul, the church was transformed into a mosque. However, the minarets were not built altogether and immediately. During a restoration in the 16th century, Mimar Sinan realized the dome was cracking. It had to be reinforced. But reinforcement would be a temporary solution. It needed to be supported.
So, Sinan decided to build three minarets as support columns from outside. The minarets are a lot thicker than usual and have a base structure.
The idea was to preserve the Islamic influence on the structure no matter who ruled Istanbul. The building would collapse immediately without the minarets. And today, it is the single most interesting museum with both Orthodox and Islamic artistic influence at every inch.