Yes it is beautiful, but it is not a mosque, it is a basilica (church) and it was built by the Romans of the Eastern Roman empire, who later became known as the Byzantines.
After Mehmed II's conquest of the city in 1453, Hagia Sophia was converted to a mosque