Santa Maria de Merlès is a municipality in Catalonia. It is officially within the comarca of Berguedà, but traditionally, it is a part of the natural comarca of Lluçanès. The municipality is located on the riera, or stream, of Merlès, from which the town takes its name. It is located about 14 kilometers east of Puig-reig, and 8 kilometers west of Prats de Lluçanès, the nearest market town.
The town is divided into two parishes, Santa Maria (in the Bishopric of Solsona) to the west of the riera, and Sant Martí (in the Bishopric of Vic) to the east.
The town was traditionally dominated by two important families, the Cortadas and the Vilaltas. Their monumental houses still stand in the municipality. A popular legend offers an explanation for the reconstruction of the Church of Sta. Maria in the 17th century.
An animosity developed between the two families, and in order to anger the patriarch of the Cortada household, the head of the Vilalta family sat one Sunday in the pew reserved for his rival. The patriarch of the Cortadas was so offended that he left church, only to return with a firearm. He killed the head of the Vilaltas in the church and, as a result, the building had to be torn down and rebuilt on the other side of the main road. Later, the patriarch of the Cortadas felt remorse for what he had done, and as penitence erected a chapel dedicated to Saint Mary Magdalene on his property, beside the main road.