"I feel very well", Luis Bárcenas told reporters as he left Soto del Real prison, north of Madrid, accompanied by his two sons.
The 57-year-old who complained of "persecution" during his 19 months in custody is one of the highest profile suspects in a vast corruption investigation — the so-called Gürtel Case — targeting senior members of the People's Party (PP).
He was linked to Prime Minister Mariano Rajoy in a separate affair in 2013, in which Bárcenas admitted running a slush fund to make undeclared payments to party members.
Bárcenas's family paid a €200,000 ($228,000) bail to secure his provisional release, a judicial source told news agency AFP.
One of 43 suspects facing trial in the principal case, Bárcenasis charged with money-laundering, tax fraud and embezzlement between 1999 and 2005.
Prosecutors have demanded a 42-year jail sentence for him.
Judges have been investigating the affair for nearly seven years and the trial is not expected to start before the general election due in November.
Rajoy said in 2013 that he had made a mistake by naming him treasurer in 2008. The prime minister denied the existence of a party slush-fund.
Bárcenas has been expelled from the party and Rajoy has launched a series of anti-corruption reforms.
The return of Bárcenas to the headlines comes at a sensitive time for Rajoy as he hopes for re-election.
The new left-wing protest party Podemos has overtaken the PP in recent opinion polls, vowing to do away with a political elite that it brands corrupt.
"Luis Bárcenas back on the street is a nightmare for the PP," said centre-right newspaper El Mundo.
"It is a raw reminder of the corruption that nestled in the PP."
On his release Bárcenas sounded a note of warning: "The PP has nothing to fear from me, but I have assumed my share of responsibility and we all have to assume our responsibilities."
Podemos has also overtaken the mainstream opposition Socialist Party, which has itself been hit by corruption scandals.