A Latvian computer code writer who helped create a virus that spread to more than a million computers worldwide and corrupted some at NASA may be returning home soon after pleading guilty to a federal charge on Friday.

Deniss Calovskis, soft-spoken and bespectacled, pleaded guilty in Manhattan to conspiring to commit computer intrusion. The 30-year-old hacker faces a likely prison term between 18 months and two years at a December sentencing, according to the terms of a plea deal with the U.S. government. Before the plea, he had faced charges that could have carried a of up to 67 years upon conviction.

Calovskis admitted that he was hired to write code for the Gozi virus.

"I knew what I was doing was against the law," Calovskis told a magistrate judge.

Arrested in Latvia in 2012, he was not extradited to the U.S. until February.

Prosecutors said the virus from 2005 to 2012 infected more than 1 million computers worldwide and 40,000 U.S. computers, including 190 at the National Aeronautics and Space Administration. Other computers were damaged in Germany, Great Britain, Poland, France, Finland, Italy, Turkey and elsewhere.

When U.S. Attorney Preet Bharara announced arrests in the case in 2013, he said it was a "wake-up call to banks and consumers" needing to know that the threat of cybercrime was not going away.

A 25-year-old Russian, Nikita Kuzmin, pleaded guilty to intrusion and in Manhattan in May 2011, admitting his role in creating the .