Media playback is unsupported on your device Media caption Sabitha Ravi tells the court that the media had misconstrued facts in the case against her son

A US student convicted of using a webcam to secretly film his room-mate in a gay encounter has been sentenced to 30 days in prison.

Dharun Ravi, 20, a former undergraduate at New Jersey's state university, could have faced up to 10 years in jail.

The judge said he would recommend Indian-born Ravi, who was convicted in March, should not be deported.

Tyler Clementi, 18, killed himself days after he was filmed kissing another man in a dorm room in September 2010.

The trial - which prompted comment from President Barack Obama, and anti-bullying measures - made front-page headlines nationally.

'Cold-hearted violation'

As he handed down sentence on Monday in New Brunswick, New Jersey, Judge Glenn Berman said he had not heard Ravi apologise once, adding that Clementi's own words - "wildly inappropriate" - best described his actions.

The judge added that he did not believe Ravi had acted out of hate for Clementi, but said he had been guilty of "colossal insensitivity".

He also berated Ravi for attempting to cover-up the crime, including deleting text messages, tweets and trying to influence a witness.

Analysis Tyler Clementi's suicide and Dharun Ravi's trial have led to a nationwide debate about cyberbullying and teenage culpability. Did Ravi's webcam spying cause Tyler Clementi's suicide? Was Ravi being immature and spiteful, or was his behaviour intentionally homophobic? The judge has clearly taken Ravi's age into account in handing down what is a lenient sentence - 30 days in prison, rather than the 10- year maximum Ravi might have faced. Prosecutors argued that a strong sentence would act as a deterrent for others who might commit crimes based on intolerance. Already some gay rights groups are expressing surprise at the short sentence.

As well as the jail term, Ravi is to serve a three-year period of probation and complete 300 hours of community service.

He must also pay $10,000 (£6,330) to a state-licensed community organisation that helps victims of bias crimes, and complete a programme on cyber-bullying and alternative lifestyles.

Judge Berman said part of the reason he was not recommending deportation was because the man who was videotaped with Clementi - known as "MB" during the trial - had written a letter asking that Ravi not be deported.

Ravi is an Indian citizen, but has lived in New Jersey for most of his life.

A gay-rights organisation in New Jersey said on Monday they were disappointed with the sentence, although they believed that 10 years would have been too much.

"This was not merely a childhood prank gone awry," Garden State Equality chairman Steven Goldstein said in a statement. "This was not a crime without bias."

Before sentence was passed, Joe Clementi, the father of Tyler Clementi, read a statement to the court, saying the impact of what Ravi did had been "severe, shocking and lasting".

Mr Clementi said his son, a "kind, gentle soul", had been the victim of a "cold-hearted violation".

His wife, Jane Clementi, wept as she read out a statement to the court saying that she was very close to her son, but "even I had no idea of the despair and torment Tyler must have been feeling".

'Demonised'

Ravi wept as his mother, Sabitha Ravi, gave a tearful statement to the court, saying how she had watched powerless as her son was "ripped apart" by the media.

Ravi's lawyer, Steven Altman, said his client had been "demonised by the gay community" and that the case was "being treated as if it's a murder case".

Last week, Ravi's supporters rallied outside the New Jersey legislative building, arguing that the state's hate-crime laws had been used on someone who was not hateful.

Media playback is unsupported on your device Media caption Jane Clementi asked why nobody spoke out against her son's humiliation and embarrassment

Ravi was found guilty of 15 counts, including invasion of privacy, but was cleared on parts of the bias intimidation charges.

Before the trial, prosecutors offered him a plea deal with no prison time, but Ravi declined.

The trial heard that Ravi used a webcam in his dormitory room to film Clementi kissing another man. Prosecutors said about half a dozen students saw the video.

Ravi then tweeted about it and tried to catch Clementi in the act again two days later.

Days later, Clementi leaped to his death, posting a status update on Facebook saying: "Jumping off the gw bridge, sorry."

Prosecutors were barred by the court from arguing that the filming had led directly to Clementi's death, while defence lawyers were prevented from saying Clementi had killed himself for other reasons.

Clementi had requested his room be changed before his death, according to testimony, and he looked at Ravi's Twitter page 38 times during the last two days of his life.

One of Ravi's tweets said: "Roommate asked for the room till midnight. I went into molly's room and turned on my webcam. I saw him making out with a dude. Yay."

Ravi did not testify during the four-week trial, nor at the sentencing hearing.