Marcus Hutchins (R), seen ahead of a 2017 court appearance, was hailed as a hero for stemming the WannaCry ransomware outbreak but later charged in the US with creating malware that could attack the banking system

A British computer security researcher called a hero for stopping a global ransomware attack but blamed for creating other damaging malware was set free Friday by a federal judge after having pleaded guilty to US criminal charges.

Marcus Hutchins, whose arrest in 2017 stunned the computer security community, was sentenced to "time served" by the Milwaukee, Wisconsin and given one year of supervised release, but will be able to travel back to Britain during that period.

He faced up to 14 months in prison for the two charges of creating and selling malware, for which he pleaded guilty in April.

Hutchins, 25, earned a reputation as a hacking hero in 2017 when he discovered a "" to stem the spread of the devastating WannaCry ransomware outbreak.

But months later he was arrested while attending the Def Con computer hackers conference in Las Vegas on charges that he and another individual created and distributed a trojan program called Kronos, which was designed to steal user names and passwords used on online banking sites.

According to the indictment, Hutchins was part of a conspiracy to distribute the hacking tool on so-called dark markets.

According to the Milwaukee Journal Sentinel, Hutchins was credited by Judge J.P. Stadtmueller with "turning the corner" on his activities, especially with regard to WannaCry.

"On one hand that makes you a hero, but it does not totally wipe out the past actions, but it is certainly to your credit without any encouragement that you stepped up to the plate without any expectation," the said.