The Armenian Church of St. Gregory the Illuminator (in Armenian, Grigor Lusavorich) was founded in 1863 at the initiative of the head of the Shemakha diocese of Vardapet Daniel Shakhnazaryants at the expense of Javad Melikov, a former employee of the Witte fields, who became rich that year by launching the first oil refinery in the Absheron region own design.
The church building was built on Kolyubakinskaya Square, or "Parapet", as it was popularly called (now Fountain Square). This place was initially proposed for the construction of the Russian Orthodox Alexander Nevsky Cathedral, but the size of the area did not match the scale of the proposed structure. Then the Baku military governor Mikhail Petrovich Kolyubakin (1811-1872) allocated this piece of land for the Armenian church.
The architect of the building was the brother of the famous artist Otto Gustavovich Gippius (1826-1883), the architect of the city of Baku and the province of K. K. Gippius. As a grandson of a Lutheran pastor, he devoted most of his life to creating the architectural style of religious churches. He built the first Lutheran church of St. Charles in Revel (Tallinn).
His second work was the building of the Armenian church in Baku. In 1869, the church was consecrated, although construction continued until 1871. In 1873, a parish school, library and buildings under the dwellings of the Diocesan church authorities were built in the fence of this cathedral. In 1888, bells were installed on the cathedral. Later, the building of the Armenian philanthropic society was built nearby, where the library is located. Since 1918, the church became a cathedral.
On the facade of the church was a six-pointed hexagram "Star of David". A thousand years ago, a hexagonal star was an international sign. It is found on early Christian amulets and in Muslim ornaments called "the seal of Solomon." In Christian churches, the hexagram is even more common than in synagogues. For this reason, there is a version that the church used to be a synagogue.
The temple was the main place of worship for a significant part of the Armenian community of Baku until it was forced to leave the city in 1988-1990 during the Karabakh conflict. In 1989, the church was subjected to an act of vandalism, all symbols of faith (including the dome cross and bell) were lost. The arson in 1990 also seriously damaged the church, the same year it was abolished.
In accordance with the decision of the Cabinet of Ministers of the Republic of Azerbaijan No. 132 dated 02.08.2001, the church was declared an architectural monument of local importance and under inventory number 3272 was taken under state protection.
In 2002, on the basis of the church, which is on the balance sheet of the presidential administration, the library of the Office for Presidential Administration of Azerbaijan was formed. Azerbaijani Culture Minister Abulfaz Garayev said that he considers the conversion of this church into a library appropriate. In 2004, the church building was rebuilt during the reconstruction of the square and adjacent buildings. The last time restoration work in the building of the Armenian church was carried out in 2011.
In April 2010, the church was visited by Patriarch of Moscow and All Russia Kirill and Catholicos of All Armenians Garegin II, who are in Baku to attend the World Summit of Spiritual Leaders. Garegin and senior Armenian clergymen accompanying him prayed and sang medieval hymns in the church.
Currently, the temple is used as a book depository of the library of the Office for Presidential Affairs of Azerbaijan.