Owing to the intense military activity at the Lleida front, this municipality suffered much during the Spanish Civil War (1936–39).
At that time it was known as Pineda de Segarra and, owing to the hardships caused by the war, paper money was printed in the town. The present-day main town was formerly known as Sant Guim de l'Estació because it was built around the railway station of the Lleida - Manresa line.
Nowadays many of the villages that make up the municipality have been depopulated as people have moved to urban areas. Most have only residual population.