In the 8th century, during the Frankish period, the monastery "Werith" was built, which was first connected with the southern French bishopric of Arles and since 778 with the cathedral chapter of Strasbourg. Around 1030 the monastery was converted into a noble canon's monastery and the collegiate church was built.
The collegiate church is the oldest place of worship still in use in Canton Solothurn. It was consecrated to Saints Trophimus (from Arles) and Leodegar (from Alsace). Originally, it had a western work with two towers and a chapel of St. Michael. The canons maintained a school. In the time of the Counter-Reformation, the church became a Marian pilgrimage sanctuary after the legendary discovery of a statue of Mary from the Bernbiet. In the second half of the 17th century it received its present baroque tower and the interior was redesigned in rococo style.
In 1874 the monastery was abolished. The church fell to the newly founded Christian Catholic parish. Since 1880 it has also been used by the Reformed Church. In 1938 a new Roman Catholic church was built above the collegiate church. Today, the three local parishes maintain a close ecumenical cooperation and hold many events and services together.
Link to the Romanesque St. Leodegar church in Alsace