MADRID, Spain - A Spanish judge has ordered the release of a young Mexican chemistry student arrested on suspicion of plotting a gas attack on protesters opposed to a visit here by Pope Benedict XVI, but the suspect remains under investigation.

Judge Fernando Andreu did not immediately bring formal charges against Jose Perez Bautista, but seized his passport and ordered him to report to a police station twice a day.

Andreu announced his decision in an order released Thursday, hours after the Pope arrived for a youth festival. The pontiff is to leave Sunday.

An anti-Pope demonstration was held Wednesday night in Madrid. Police had arrested the Mexican on Tuesday because of threats he made on the Internet against anti-Pope demonstrators due to take part in that rally.