A Spanish court has released a man charged over the March 2004 Madrid train bombings after authorities did not apply to hold him for longer.
More than 190 people were killed and hundreds injured in the attacks
Moroccan national Saed El Harrak was freed on Wednesday after serving the maximum two-year period suspects can be kept in prison without trial.
Authorities failed to apply for a two-year extension. An investigation has been ordered into his release.
Mr Harrak is one of 29 charged over the attacks in which 191 people died.
Spain's General Council of the Judiciary says it plans to investigate how he came to be released.
Mr Harrak was arrested shortly after the bombings. Police said he had held telephone conversations with suspects who blew themselves up in a apartment on 3 April as police moved to arrest them.
His telephone number was later found in the apartment, police said.
He has been charged with collaboration with a terrorist group and the prosecution is seeking a 10-year sentence.
The investigating judge, Juan del Olmo, had recommended an extension for Mr Harrak but was on medical leave when Judge Teresa Palacios took the decision to release him.
Spanish daily El Pais said the release came about because of a lack of coordination between officials, the Associated Press news agency reported.
Judge Palacios has ordered Mr Harrak to register with police twice a day and banned him from leaving the Madrid region.