Small St. Sofia Mosque or St. Sergius and Bacchus church with its former name, which is the useable oldest structure of Istanbul today, was constructed between the years 527-536. According to the legends stated in the sources about the construction of the building (Millingen 1912), at the 1st Anastasyus Period, 1st Justiniaunus and his uncle 1st Justinos were condemned to death due to an allegation that they had a rebellion against the Emperor Anastasyus. One night before the execution, the Emperor Anastasyus sees the saints St. Sergius and Bacchus in his dream and the saints testifies in favor of 1st Justiniaunus and 1st Justinos. The emperor, who is affected by this dream, forgives them. When 1st Justiniaunus becomes emperor, he establishes St. Sergius and Bacchus church as a vow church in order to show his gratitude to these saints.