MADRID — The suspended president of the Spanish football federation, his son and another soccer official have left a Madrid prison a day after being granted bail.

Angel Maria Villar, his son Gorka Villar, and suspended federation vice president Juan Padron all left the Soto de Real prison on Tuesday. They had spent 12 days behind its walls since a court sent them there while investigators continued their probe into alleged corruption.

Angel Maria Villar told journalists gathered outside the prison that he wanted “to thank all those who had privately and publicly believed in me, in Mr. Juan Padron, and my son.”

“They have defended us both in public and private,” Villar said in his first statement since being arrested on July 18.

Judge Santiago Pedraz granted bail to the three men on Monday after having initially denied them bail on July 20 citing flight risks.

Judge Pedraz set bail for Angel Maria Villar and Padron at 300,000 euros ($350,000), and for Gorka Villar at 150,000 euros ($175,000). The judge also confiscated their passports and ordered that the three suspects make weekly appearances at the court and provide a phone number to reach them at all times.

A fourth suspect, Ramon Hernandez, had already been granted and paid a bail of 100,000 euros ($117,000).

A state prosecutor has accused the four of improper management, misappropriation of funds, corruption and falsifying documents.

Villar, who ran the Spanish federation since 1988, was suspended from the federation’s presidency for one year last week by Spain’s top sports authority. He also resigned from his vice presidencies of both FIFA and UEFA.

The state prosecutor suspects Villar of misappropriating private and public funds received by the federation since 2009.