He took his degree in Law in 1869 and Arts in 1871 in Seville, where he worked as a lawyer for a period of time. In 1874, he married Ana Ruiz and had six children, two of them were the great poets Antonio and Manuel.He devoted himself to study folklore. He founded the society 'El Folklore Andaluz' and took part in all folklore societies in Spain, including the Galician Society 'El Folklore Gallego', which was formally opened in 1884. Emilia Pardo Bazán was the president of this society.
In 1881, he wrote and published Bases del Folklore Español.In relation to popular literature of oral tradition, these are some of his works about Galician theme: De la poesía popular gallega (included in La Ilustración Gallega y Asturiana), Analogía y semejanza entre algunas adivinanzas gallegas y castellanas (in La Ilustración Gallega y Asturiana) and Analogía entre algunas cántigas gallegas y otras coplas andaluzas, castellanas y catalanas (appendix to the first volume of Cancionero Popular Gallego).He also created and directed the Library of popular traditions, which consists of eleven volumes, four of them about Galician themes (three of them have the Collection of songs by Pérez Ballesteros and the other one is a volume with short Galician works by Machado).