A US judge in Georgia has overturned a ruling in which a 17-year-old man was imprisoned for 10 years for having consensual oral sex with a teenager.
Mr Wilson will no longer be required to register as a sex offender
Genarlow Wilson, now 21, was jailed in 2005 for aggravated child molestation after he was videotaped engaging in the act with a 15-year-old girl.
The judge amended Mr Wilson's felony sentence to 12 months for misdemeanour.
The ruling has not led to his release, however, as Georgia's attorney-general has said he will be filing an appeal.
The case has provoked controversy in the US with high profile figures, such as former President Jimmy Carter, supporting the release of Mr Wilson.
'Miscarriage of justice'
Mr Wilson, a former high school honours student and star athlete, was found guilty by a jury of aggravated child molestation for having oral sex with a 15-year-old girl at a New Year's Eve party in 2003.
At the time the crime carried a mandatory minimum sentence of 10 years and a lifetime registration on the state's sexual offender list.
Under Georgia law, if Mr Wilson had engaged in sexual intercourse with the girl he would have only been charged with a misdemeanour and would have received a much lighter sentence.
In his ruling on Monday, Superior Court Judge Thomas Wilson ordered Mr Wilson's release and said he would not be required to register as a sex offender.
"If any case fits into the definitive limits of a miscarriage of justice, surely this case does," he said.
"The fact that Genarlow Wilson has spent two years in prison for what is now classified as a misdemeanour, and without assistance from this court will spend eight more years in prison, is a grave miscarriage of justice."
However, Attorney-General Thurbert Baker said he would file an appeal against the ruling, stating that Georgia law did not give a judge authority to reduce or modify the sentence imposed by a trial court.
Mr Wilson's lawyer, BJ Bernstein, said: "It is extremely, extremely disturbing that the attorney general would take this action now."
"In essence, the attorney general is saying, 'Keep Genarlow Wilson in prison for 10 years and keep him on the sex offender registry'," she added.
She is planning to apply for a bond to release Mr Wilson while the appeal is pending.
But a public affairs officer for the state department of corrections said Mr Wilson could not be released until they received guidance from the state attorney general's office or from the court that originally sentenced him.