The Spanish clergy has long been criticised for its failure to investigate allegations of sexual violence.
Spanish MPs have voted to set up a commission of experts to conduct the country's first official investigation into sexual abuse within the Catholic Church.
An independent commission will examine "the execrable personal acts committed against defenceless children," according to the bill.
It has also been set up to identify "those who committed these abuses, as well as those who covered up or protected them."
Unlike other European countries, Spain has not held a major probe into allegations of child abuse and sexual violence by members of the clergy.
The unprecedented investigation was approved by a large majority of 286 lawmakers, while just 51 voted against and two abstained. The inquiry was proposed by the ruling Socialist Party and the Basque party PNV, while only far-right MPs from Vox opposed the text.
The independent commission will be chaired by an Ombudsman and include representatives of the government, victims and the Church itself.
According to a Spanish media study in 2018, 1,246 victims of sexual abuse within the Church have been identified since the 1930s.
The Spanish Catholic Church has long been accused of ignoring the church abuse scandal and had only recognised 220 such cases since 2001.
On Friday, the church said it had identified more than 500 cases of alleged historical sexual violence since an inquiry was launched in 2020.
Socialist Prime Minister Pedro Sánchez wrote on Twitter that the investigation was "a first step to try to repair the pain of the victims, who had not been heard until now."
Podemos -- a left-wing member of the ruling coalition -- had called for a parliamentary commission to investigate but the Socialists opted instead for a commission of experts, copying the model in France and the Netherlands.
An independent study in France eventually found that around 330,000 children had been sexually abused since 1950 by clerics, religious or people connected with the Church.
In Germany, a similar report in January found that at least 497 people -- mostly young boys and teenagers -- had been sexually assaulted in the Archdiocese of Munich-Freising between 1945 and 2019.
In February, Spanish church officials did announce a new external audit to go "all the way" to shed light on historical sexual violence.
"It seems to us that we must take a further step in helping and supporting the victims," said Cardinal Juan José Omella, president of the Spanish bishop's conference.