A British student who created a website that let people watch films and television shows for free has struck a deal with the United States to avoid extradition, London’s High Court heard on Wednesday.

Richard O’Dwyer, a 24-year-old student at Sheffield Hallam University, allegedly earned thousands of pounds through his TVShack website before US authorities closed it down over copyright infringement claims.

He could have faced jail in the US. But his lawyer Edward Fitzgerald told the court that the student had signed a draft deal that will see him travel to the US and pay compensation, but avoid a trial and criminal record if found guilty.