A computer hacker who helped the US government disrupt hundreds of cyberattacks and cripple the hacktivist crew known as Anonymous will serve no more time in prison after being sentenced to time served.
US District Judge Loretta Preska credited Hector Xavier Monsegur's "extraordinary co-operation" as she announced the sentence in Manhattan.
Afterwards, a relieved Monsegur hugged prosecutors who had urged leniency.
He had spent seven months behind bars but has been free while awaiting sentencing.
Working around the clock with FBI agents at his side, Monsegur "provided, in real time, information about then-ongoing computer hacks and vulnerabilities in significant computer systems", prosecutors wrote.
The FBI estimates he helped detect at least 300 separate hacks - including on Congress, Nasa and other sensitive targets - preventing millions of dollars in losses.
He was arrested and pleaded guilty in 2011.
Monsegur first began hacking in a Manhattan apartment in the early 2000s, according to court papers. His aim then was to steal credit card information, then sell it or use it to pay his own bills.
In a 2011 interview with an online magazine, Monsegur said he decided to join forces with Anonymous because he was upset over the arrest of WikiLeaks founder Julian Assange.
Starting in early 2011 and using the alias Sabu, Monsegur led an Anonymous splinter group called Lulz Security, or LulzSec, which hacked the computer systems of Fox television, Nintendo, PayPal and other businesses, stole private information and bragged about its exploits online.
The group was loosely affiliated with Jeremy Hammond, the FBI's most wanted cybercriminal, whose stated objective was to cause mayhem with the attacks, prosecutors said.
When FBI agents showed up at Monsegur's home in the summer of 2011, he immediately agreed to co-operate, giving the FBI a tutorial on the inner workings and participants of LulzSec and Anonymous, prosecutors said.
Under their direction, he "convinced LulzSec members to provide him digital evidence of the hacking activities" and "asked seemingly innocuous questions that ... could be used to pinpoint their exact locations and identities", court papers said.