(Bloomberg) -- The British man whose bogus trades may have contributed to a $1 trillion selloff in global stock markets during the 2010 Flash Crash will avoid prison after admitting to fraud and securities crimes, a U.S. judge ruled.

Navinder Sarao, 41, must serve a year of home detention in London, U.S. District Judge Virginia Kendall said Tuesday in Chicago. The sentence is a remarkable outcome for Sarao, who was initially charged with 22 criminal counts carrying a combined maximum sentence of 380 years.

But even the U.S. Department of Justice had asked the judge to spare him from serving more time behind bars, after he spent four months in a London jail following his arrest in April 2015. The government cited his “extraordinary cooperation” with the criminal probe and a diagnosis of Sarao showing he has Asperger’s syndrome.

At Tuesday’s hearing, a probation officer told Kendall that her order of home detention in the U.K. may not be enforceable by U.S. authorities.

Sarao was among the world’s biggest traders of futures contracts tracking the S&P 500 Index -- regularly placing orders worth tens of millions of dollars -- while using a computer in the bedroom of his parents house, where he’d lived since childhood.

Read More: Spoofing Is Silly Name for Serious Market Rigging

But he also used an illegal market-influencing technique known as spoofing, in which he placed huge orders and then canceled them before they could be executed. His massive bogus trades helped start the flash crash on May 6, 2010, which erased $1 trillion in market value in minutes, authorities said.

Sarao pleaded guilty to wire fraud and spoofing in 2016 and helped prosecutors build cases against other alleged market cheats, according to the government.

“The defendant’s keen insights and explanations regarding both general and specific patterns of deceptive and manipulative trading have illuminated the government’s understanding of similar spoofing,” the DOJ wrote in its sentencing memo. “As a result, he has substantially assisted and informed the government’s nationwide efforts to detect, investigate, and prosecute these crimes.”

(Updates with background on case.)

To contact the reporter on this story: Liam Vaughan in London at lvaughn6@bloomberg.net

To contact the editors responsible for this story: Robert Friedman at rfriedman5@bloomberg.net, Steve Stroth

©2020 Bloomberg L.P.