The World Anti-Doping Agency (WADA), the International Cycling Union (UCI) and Spain's anti-doping agency were among organisations who had lodged appeals against a judge's decision in 2013 that the samples should be destroyed.
The verdict comes 10 years after a series of police raids, known as "Operation Puerto", seized 211 bags of blood and plasma, as well as anabolic steroids and blood transfusion equipment, from the offices of Eufemiano Fuentes, a doctor in Madrid.
Fuentes worked with a number of cyclists, but also with athletes in other sports and the discovery sent shockwaves through the international sports community.
"The means to the end is to fight against doping, which violates against the essential ethical value of sport, fair play, as it prevents for competition to occur under the same conditions," Judge Alejandro Maria Benito said in delivering Tuesday's verdict.
WADA had been calling on authorities to release the blood samples, which are frozen in a laboratory in Barcelona.
“We are dismayed that it took so long to receive the decision but we will now partner with the other parties that have been granted access (to the blood bags), to determine our legal options vis-a-vis analysing the blood and plasma bags,” WADA Director General David Howman said in a statement.
Fuentes was handed a one-year suspended sentence in 2013 for endangering public health and was also barred from practicing sports medicine for four years.
Fuentes had admitted helping athletes to dope but could be tried only for public health offences because doping was not illegal in Spain when his clinic was raided in 2006.
He was cleared on Tuesday because the judge ruled he could not have endangered the health of his clients because he only used blood and not drugs when doing transfusions.
Media attention around the scandal focussed on professional road cyclists, however, sports people from other disciplines were also connected to the case.
Tuesday's ruling will allow anti-doping agencies to examine the blood bags using the latest scientific methods to identify athletes from a range of sports, who used Fuentes’ services but have yet to be unmasked.
It is unclear, however, if those athletes could still face punishment, as WADA's eight-year statute of limitations -- the maximum time within which proceedings could be initiated -- that was in place in 2006 has passed.
International Cycling Union (UCI) statement
The UCI welcomes Madrid court decision to provide access to “Operation Puerto” athlete blood bags
The Union Cycliste Internationale (UCI) today welcomed the decision taken by the Madrid Court of Appeal to provide the World Anti-Doping Agency (WADA), the Spanish Cycling Federation (RFEC), Italian National Olympic Committee (CONI) and the UCI with access to stored “Operation Puerto” blood and plasma bags of athletes from cycling and other sports.
UCI President Brian Cookson said: “The UCI applauds this decision. Although it is regrettable that we had to wait this long, in the end the message sent is clear.”
The UCI will now partner with WADA, the RFEC, Agencia Española de Protección de la Salud en el Deporte (AEPSAD) and CONI, to determine the legal options available with regards to analysing the blood and plasma bags; and, where applicable, pursuing anti-doping rule violations.
The UCI will make no further comment at this time.