The court in El Escorial near Madrid, where the mausoleum is located, was ruling on a request from Maria Purificacion Lapena, granddaughter of a man executed by Franco's forces.
In September 2015, Lapena asked the court to order the exhumation of the body of her grandfather, Manuel Lapena Altabas, and great-uncle Antonio Lapena Altabas so that they could be given a proper funeral.
The two men, both members of an anarchist group, were killed at the outset of Spain's 1936-39 civil war and buried in a mass grave in the northeastern region of Aragon.
In 1959, their remains were transferred without the consent of their family to the Valley of the Fallen, which became Franco's final resting spot when he died in 1975.
In a ruling dated March 30th which was only published on Monday, the court ordered the “return of the remains of the Lapena Altabas to their relative Maria Purificacion Lapena after they are identified so that they can be given a proper burial”.
This is the first time that a court has authorised the exhumation of bodies from the Valley of the Fallen, Lapena's husband Miguel Angel Capape, a member of campaign group Arico which works to identify bodies from mass graves, told AFP.
“This has been years of work, of going from one court to another… finally a door has opened and we can see the end of the road,” he added.
The Association for the Defence of the Valley of the Fallen said it would “take all necessary legal action” to prevent exhumations from taking place at the site, arguing it would “violate” the rights of the families who do not want the remains of their loved ones at mausoleum to be touched.
Built by Franco's regime between 1940 and 1958 in the granite mountains of the Sierra de Guadarrama, the Valley of the Fallen holds the remains of over 30,000 dead from both sides in the civil war.
Franco lies buried behind the high altar of a vast basilica hewn into the rock, which is capped by a vast 150-metre (500-foot) high cross that can be seen for miles around.
The dictator dedicated the site to “all the fallen” of the civil war but because the monument was built in part by the forced labour of political prisoners, many who died during the works, the site has long been a rallying point for the far right in Spain.
Attempts to depoliticise the site by removing Franco's body, or transform it into a memorial that better recognises losses on both sides of the conflict, have so far gotten nowhere.
The remains of tens of thousands of other victims of the civil war, mainly from the losing Republican side, remain scattered in unmarked mass graves across the country.
A Historical Memory Law passed by Spain's previous Socialist government in 2007 allows relatives to exhume and recover the remains of loved ones in mass graves and calls for public funds to be provided to help cover the costs.
But funding for such projects dried up after the conservative Popular Party came to power in 2011. The party argued that allowing exhumations re-opens old wounds.
By Adrien Vicente / AFP