The white-and-blue Our Lady of Sorrows Church was the first newly built stone Catholic church in Riga (1785) after the Reformation had reached Livonia, a historic region once encompassing present-day Latvia and Estonia.
The idea of constructing the church was especially supported by Austrian Emperor Joseph II. The Classicism-style building was dedicated to Our Lady of Sorrows symbolising the oppressed Catholic religion in Terra Mariana.
From 1859 to 1860, the church was rebuilt according to the design of Riga architect Johann Felsko – the presbytery was moved to the opposite south-western or Daugava side, the sacristy was added, and the façade of the church was redesigned in a Pseudo-Romanesque style. In 1895, an eight-sided Neo-Renaissance baptistery was built on the west side of the church, designed by Wilhelm Bockslaff.