A Spanish judge , Fernando Andreu , ordered the Somali men released on Friday .