Sant Martí is the current parish church of Riells and Viabrea. The building is of Romanesque origin (12th century), though in the 15th century, it was reformed due to damage suffered during the War of the Remences. In the 17th century, the church was widened and in the next century, the rectory annex was built. However, during the Spanish Civil War of 1936-39, it again suffered significant damage at the hands of revolutionary organisations. In 1956, a project of restoration was begun under the supervision of Pere Ribot, rector and poet. In the document “Constitucions dels castells” (Constitutions of Castles) of 1358, the parish of la Riells is mentioned as an integral part of the Montsoriu district, the principal castle of the Viscount of Cabrera.