This is the only Byzantine church to remain continuously in the hands of its Greek congregation to this day. This unusual right of ownership was bestowed upon the Greek congregants by imperial decree under the sultanate of Fatih Mehmet. The firman, or sultan's imperial seal, is on display in the interior of the church.
According to tradition, this church was built (or rebuilt) around 1282 by Princess Maria Palaeologina, illegitimate daughter of Emperor Michael VIII Palaeologus. (Other sources suggest that the church was founded by Isaac Dukas, uncle of Michael VIII, around 1261.) The princess was married off to a Mongols Khan by her father in 1265, but after the death of her husband 15 years later (assassination, actually), Maria returned to Constantinople, founded the church and a convent, and lived out the remainder of her life as a nun.
The building was originally constructed on a traditional quatrefoil plan, but the southern end of the church was completely destroyed, to be replaced by an incongruous square narthex that distorts the harmony of the original. The one major treasure remaining from its Byzantine period is a portative mosaic of Theotokos Pammakaristos, "the All-Joyous Mother of God."