A convicted hacker turned FBI informant who was facing more than 20 years in jail has walked free.

Hector Xavier Monsegur was arrested in 2011 on hacking charges but agreed to cooperate with the authorities.

Inside a New York court on Tuesday the judge praised the hacker, known as ‘Sabu’, for helping to foil at least 300 cyber attacks.

Monsegur was sentenced to seven months already served and one year’s probation.

The hacker was said to be the leader of the LulzSec, an off shoot of the cyber hacking group Anonymous.

The hacktivist community is reported to have reacted angrily to the sentencing.