A school in Pennsylvania allegedly forced a gay student to watch anti-LGBT propaganda after they caught him watching gay porn.

A court document from a federal court case between The Milton Hershey School and student Adam Dobson reveal that Dobson said he was subjected to “gay cure” therapy.

The school is a private boarding school in which students live and are supervised by “house parents”.

Dobson alleged that after he was caught watching gay pornography as a freshman in 2010.

He says he was then forced by his “house parents” to watch homophobic propaganda as punishment.

The propaganda film Dobson reportedly was made to watch was called One of the Boys.

The film is made by ex-gay activist Sy Rogers who claimed that he was gay and had considered transitioning his gender.

In the video, he claims that he stopped these feelings and became straight and cisgender through prayer and Bible study.

As well as being forced to watch the video, Dobson has claimed that his house parents would force him to pray to not be gay.

“We would pray together to have God help me from being gay,” he said.

Dobson, who attempted suicide at the school, was also bullied as he was told about the “terrible things that happened to other gay people”.

The student was expelled in 2013 after his suicide attempt.

The school has denied all the claims in a statement that said the allegation was “outrageous” and “a practice the administration would never allow or condone”.

“Unequivocally, the school does not promote or endorse any program that could be remotely characterised as gay conversion therapy.

“Any suggestion otherwise is a gross mischaracterization of our values and the environment on our campus,” a spokesperson said.