Hector Xavier Monsegur, better known by his screen name "Sabu", was first arrested in 2011 and had already served seven months in jail before being released on bail in December 2012.
The original charges could have landed him in prison for decades but the government asked for him to be exempt from even a mandatory minimum sentence given his "extraordinary cooperation."
Before walking out of the US federal court a free man, he told the judge that he would not see him back.
Sabu and fellow plotters carried out hacks that cost companies tens of millions of dollars, defaced websites and stole personal information of customers or employees, court papers said.
Also Read
The New Yorker was a prominent hacker with the activist group Anonymous, which has staged cyber assaults on MasterCard, PayPal and other commercial and government targets.
After his arrest he became a Federal Bureau of Investigation informant, helping to foil or limit 300 cyber attacks that could have caused millions of dollars of damage, prosecutors said.
He pleaded guilty to nine counts of computer hacking and one count each of credit card fraud, conspiring to commit bank fraud and aggravated identity theft.
He had admitted to being involved in cyber attacks on MasterCard, PayPal and Visa and on the Algerian, Tunisian, Yemeni and Zimbabwean governments.
He set up Anonymous offshoot Lulz Security, or LulzSec, which in 2011 engaged in major hacks into and theft from computer servers of US and foreign corporations.
Its victims included Fox Television, compromising a database of contestants in reality show "X-Factor," the website of US public broadcaster PBS, the US Senate and an affiliate of the FBI.