A bill which formally condemns for the first time the 40-year dictatorship of General Francisco Franco has been approved by Spain's parliament.
Franco's bid for immortality: The Valley of the Fallen
The measure declares illegitimate the summary military trials which led to the imprisonment or execution of thousands of Gen Franco's opponents.
It also requires all statues, plaques and symbols of the dictatorship to be removed from public buildings.
The conservative opposition said the government was re-opening old wounds.
The legislation, known as the "Law of Historical Memory", must still pass the Senate, although correspondents say this is a formality.
It would require local governments to fund efforts to unearth mass graves from Spain's 1936-39 Civil War.
Emilio Silva, president of an organisation that campaigns to exhume the bodies of civilians killed by Gen Franco's forces, said: "This is a very important moment for Spain.
"But this law is the beginning, not the end, and it is long overdue."
Socialist Prime Minister Jose Luis Rodriguez Zapatero, whose own grandfather was among those executed by Gen Franco's forces, has made the bill a government priority.
But conservative former Prime Minister Jose Maria Aznar, Mr Zapatero's predecessor, has said it is not for the government to "dig up tombs".
The deputy leader of Mr Aznar's Popular Party, Angel Acebes, said before Wednesday's vote: "Zapatero wants to divide Spaniards and turn them against each other."
The legislation also seeks to make symbolic amends to all victims of the war.
This includes Roman Catholic clergy and others killed by militias loyal to the leftist Republican government that Gen Franco rose up against.
Last weekend the Vatican beatified nearly 500 Roman Catholics executed during the civil war, in the largest ceremony of its kind ever held.