The drug traffickers, captured by Spanish in international waters by Spanish authorities, had originally been freed after Spain's National Court ruled Spain did not have the power to prosecute them.
That ruling came after the Spanish Parliament green-lighted the country's controversial new Universal Justice Law which prevents Spanish judges from trying crimes committed outside Spain.
But the Supreme Court ruled unanimously on Wednesday to uphold an appeal from a prosecutor hoping to try 13 Egyptian citizens and eight Syrians suspected of transporting huge hashish shipments.
that existing international treaties allow for Spain to prosecute drug suspects captured in international waters, Spain's national TV broadcaster RTVE reported on Thursday.
The decision is a serious blow to the Universal Justice Law which could could lead to shelving of high profile international cases including investigations into allegations of Chinese genocide in Tibet in the 1980s and 1990s and US torture at their military prison facility at Cuba's Guantanamo Bay.
The new law has also been challenged by National Court judge Santiago Pedraz who has said he won't stop investigating the 2003 death of Spanish cameraman José Couso in Iraq.
Couso was one of three journalists killed on April 8th 2003 in Baghdad during the US invasion of the city.
Explaining his ruling, Pedraz said he was obliged to pursue the case under the Fourth Geneva Convention, ratified by Spain, which deals with the protection of civilians during war time.