The Holy Forty Martyrs Church was built and painted on the order of Bulgarian tsar Ivan Asen II in honor of his important victory near Klokotnitsa over the Despotate of Epirus under Theodore Ducas on 9 March 1230. The name of the church came naturally as the battle took place on the day of the feast of Holy Forty Martyrs of Sebaste. A royal church during the reign of Ivan Asen II, it was the main church of the Great Lavra Monastery at the foot of Tsarevets on the left bank of the Yantra River.
The Holy Forty Martyrs Church, an elongated six-columned basilica, has three semicircular apses and a narrow narthex from the west. Another building was added later to the west side of the church. The church interior was covered with mural painting probably in 1230. On the western addition some of the outer decoration survived revealing the traditional arches and coloured small ceramic plates inserted into the wall. It is not clear if the church has frescoes painted on the outer walls.
Saint Sava, the most important saint of the Serbian Orthodox Church, was first buried at the church after he died on 14 January 1235 or 1236 during a visit to Tarnovo, but his relics were moved to Serbia shortly after that, on 6 May 1237.
In the first years of Ottoman rule, the church preserved its Christian character, possibly until the first half of the 18th century. It was then converted to a mosque, with the mural paintings, the icons and the iconostasis being destroyed and alterations being made to the structure itself in 1853. Only a limited number of paintings are preserved, primarily from the northern half of the narthex's west side.
The Forty Martyrs Church was also the location of then-Prime Minister of Bulgaria Stefan Stambolov's lavish wedding to Polikseniya Kostaki Stanchova on 18 May 1888. The full independence of Bulgaria from the Ottoman Empire was proclaimed by Tsar Ferdinand on 22 September 1908 in the church.
Archaeological research of the church began as early as the 1850s, but excavations were first made in 1906 and 1914, after it was badly damaged by an earthquake in 1913.
Systematic archaeological research of the church started in 1969. In 1972, a royal burial of a 1.9 m-tall accoutred man was excavated that included a massive (61.1-gram) gold ring bearing a heraldic image and the inscription Kaloyanov prasten (КАЛОIAНОВ ПРЪСТЕНЪ, "Kaloyan's ring") in negative (see photo). After extensive reconstruction works, the Holy Forty Martyrs Church was fully renovated in the 2000s and opened once again to the public, with an official inauguration on 14 September 2006. The modern church greatly resembles its medieval structure. Following the church's reconstruction, it has been used as the burial place for the remains of Bulgarian emperors and nobility, among whom Kaloyan of Bulgaria.
Some of the Bulgarian Empire's most significant historical records are stored in the church, including Omurtag's Column, Asen's Column and the Border Column from Rodosto from the rule of Khan Krum. The columns of Khan Omurtag and khan Krum are written in Greek language. The inscription of the column of Krum "Fortress of Rodostro" has been turned upside down. The inscription of Omurtag is about building of a new glorious palace on Danube river, location is still unknown. The second part of the inscription is a legacy for the new generations to remember the deeds of Omurtag. These columns were placed in the church by Ivan Asen II as a tribute to his mighty ancestors.