Image caption Richard O'Dwyer said he never thought he was breaking the law

A student ordered to pay £20,000 by a New York judge after US authorities said he broke copyright laws says he is "happy it's finally over".

Richard O'Dwyer travelled to the US voluntarily after spending more than two years challenging whether he should be extradited to face charges.

The US authorities claimed the 24-year-old's TVShack website hosted links to pirated films and TV programmes.

Mr O'Dwyer, from Sheffield, is expected to return to the UK later.

He signed a deferred prosecution agreement, in which he said he would not break any US laws. If he complies with the agreement, the case will be dropped.

Mr O'Dwyer attended the New York Southern District federal court with his mother, girlfriend and UK and US lawyers.

After the court appearance, he told the BBC: "I'm happy it's finally over. I still maintain I never thought I was committing a crime.

This matter could have been dealt with over two years ago without the threat of extradition, which in my view is using a sledgehammer to crack a nut Julia O'Dwyer

"I'm glad the US has decided to drop the case. It's a pity the UK wasn't able to resolve this."

He added: "I'm looking forward to getting back to university and see all my friends."

Mr O'Dwyer's barrister Ben Cooper said in a statement: "So far as we know this is a first in extradition cases - and a sensible solution for UK defendants faced with an ever-growing extra-territorial reach of US prosecutions."

Mr O'Dwyer's mother Julia, who campaigned tirelessly to stop her son being extradited, said: "We are very pleased and relieved to have been able to resolve this matter.

"We would like to thank the prosecutors who have been willing to engage in dialogue and recognise that this conduct did not merit the extradition, incarceration and criminalisation of my son.

"This matter could have been dealt with over two years ago without the threat of extradition, which in my view is using a sledgehammer to crack a nut."

Repay victims

Earlier this year Home Secretary Theresa May approved Mr O'Dwyer's extradition, which he appealed against.

On 28 November a deal was struck at the High Court in London to avoid him being extradited and led to him signing the three-page deferred prosecution agreement.

The Sheffield Hallam university student could have faced jail if convicted of the allegations, which were brought following a crackdown by the US Immigration and Customs Enforcement agency.

The agency claimed the TVShack.net website earned more than $230,000 (£147,000) in advertising revenue before US authorities obtained a warrant and seized the domain name in June 2010.

Mr O'Dwyer's extradition application from earlier this year is expected to return to the High Court so it can formally be disposed of.

A spokesperson for Mr O'Dwyer said the £20,000 he has been ordered to pay will be used to repay victims whose copyrights were infringed by TVShack.

Mr O'Dwyer will have no criminal record and will not be subjected to any travel restrictions as a result of the court case.