A Madrid court on Thursday shelved a five-year-old investigation into the Israeli raid on the Gaza-bound Marmara flotilla.
The investigation could potentially be re-opened if Prime Minister Benjamin Netanyahu ever visits Spain.
The 2010 raid killed nine Turkish activists, while a tenth Turk died four years later from his injuries. Spanish activists were also present on the ships.
Spain has been pioneering the use of universal jurisdiction, a concept where crimes against humanity can be prosecuted across borders. The law has recently been changed, however, so that judges can only investigate such cases if there is a Spanish connection, either victim or perpetrator.
The Madrid court said in a written ruling on Thursday that it was closing the case against Netanyahu and several of his ministers, which accused them of crimes against humanity.
But left the possibility that the case could be re-opened, saying the investigation was closed until Netanyahu and those targeted by it came to Spain.
The statment did not make clear what steps would be taken if they did.