Known as the “Law on Democratic Memory”, the legislation makes the state responsible for finding and identifying the remains rather than leaving the task to relatives.
Campaigners say the remains of more than 100,000 people are in unmarked graves across Spain, a figure which Amnesty International says is only exceeded by Cambodia.
Franco’s Nationalists won the 1936-1939 civil war and honoured their own dead but left their opponents in unmarked graves.
Many more people went missing or were killed under the dictatorship, which ended with Franco’s death in 1975.
The bill is expected to be passed by parliament despite hostility from the main right-wing opposition, which says the left is needlessly opening old wounds and has promised to repeal the law if reelected.
“Today Spain is settling a historic debt with its past. We have passed the democratic memory law that lets us move towards recognising the victims of the civil war and the dictatorship,” tweeted Prime Minister Pedro Sánchez.
“It is a much-needed law that lets us become a better country.”
The passage of time and the lack of records about the executions has made both finding and identifying victims difficult.
The bill sets aside public money to search for the missing, map the mass graves and create a DNA database to help identify the remains.
It also annuls the convictions of opponents of the Franco regime and provides for the appointment of a prosecutor to probe human rights abuses during the civil war and dictatorship.
Until now, all such moves have been prevented by a 1977 amnesty law, which was seen as essential to avoid score-settling in the fledgling democracy.
Under a 2007 law, the state simply offered support to help families trace and exhume relatives buried in unmarked graves.
But Sanchez’s government has sought to bring Spain in line with other European countries that have gone through dictatorships.
“With this law, we are making Spain… a more dignified country,” said Democratic Memory Minister Felix Bolanos.
He added that the law took care of the victims and did not forget those who died fighting a dictatorship.
Spain has been criticised for shortcomings in its efforts to address the legacy of the civil war and the dictatorship.
The UN Human Rights Council said leaving victims’ relatives to search for their loved ones highlighted “the indifference of state institutions”.
Since coming to power in 2018, Sanchez has made several moves to deal with Franco’s legacy.
In October 2019, he had Franco’s remains transferred from a vast basilica near Madrid to a small family plot.