It was founded by the count Wilfred the Hairy (called Guifré el Pilós in Catalan) in 879, who used it as a centre to repopulate the region after conquering it. The monastery became the family mausoleum for the Catalan counts, and well as a great center of learning, with a large library.1
The library and much of the monastery's vast archives were destroyed by fire in 1835.