The first wooden church was built on the Toompea hill in 1219, just after the capture of the country by the Danes. In 1229, the Dominicans came to the city, who began building a stone temple in its place. The monks were killed in 1233, during the conflict between the Order of Livonian Brothers of the Sword and the supporters of the papal legate. Since then, the unfinished walls of the temple were abandoned, and the building was completed and ordained only in 1240. During the 14th and 15th centuries the cathedral was gradually expanded and developed. Unfortunately, it suffered greatly during the fire of 1684, when all wooden equipment was destroyed and also part of the vaults collapsed. The reconstruction was carried out two years later. During the eighteenth and nineteenth centuries the church underwent numerous rebuildings, which mainly affected the tower, side chapels and interior.
The church from the mid-13th century was a simple, aisleless building with a square chancel. At the beginning of the fourteenth century, it was enlarged by the construction of a new presbytery and the addition of a sacristy. In 1330, the expansion of a single-nave to three-nave structure began. The prolonged reconstruction was completed only in the 30s of the 15th century, when the 29 meter nave corpus in the form of a basilica was completed.