Brandon Mayfield – who had converted to Islam - was detained in Portland, Oregon after a single fingerprint on a bag with detonators found near a Madrid train station was said to match his.
"I just want to say, thank God, everyone who was praying for me when I was in the Multnomah County Detention Centre," Mayfield said after his release.
Flanked by his Egyptian wife and brandishing the Quran and prayer mat provided to him by authorities, Mayfield spoke several phrases in Arabic and English offering praise to God.
Spanish officials have blamed al-Qaida for the 11 March bombings, that left 191 people dead and another 1900 injured.
Mayfield's attorney said he could not discuss details of the case, citing an official gag order linked to an ongoing grand jury investigation.
But he emphasised that Mayfield had always maintained he was innocent and lacked any knowledge about the bombings since he was arrested on 6 May.
Mayfield once did child custody work for a man who was convicted of plotting to travel from Oregon to Afghanistan with a group of Muslims to help al-Qaida and the Taliban fight US forces.
He was held as a material witness in the Madrid case, which allowed authorities to hold him without charges and severely limit his access to attorneys, family and friends.
Friends of Mayfield alleged his being a Muslim convert had helped arouse the suspicion of US authorities.