(Getty)

Two teenagers have been spared jail over a homophobic attack on a London tube, in which they put a man in a headlock and made him say sorry for being gay.

The boys, aged 16 and 17, from Newham in East London, appeared before Bexley Youth Court charged with the attack last week, reports News Shopper.

Will Mayrick, 19, was abused on a Jubilee Line train between West Ham and North Greenwich in October 2017.

The victim, who was in fancy dress on the way to a Halloween party, was verbally abused, placed in a headlock and forced to apologise for being gay by two men, the court heard.

The victim spoke out about the attack in December, saying that he’s “proud of the fact that I’m gay, I would never want to change,” and adding: “I’m not sorry.”

A 25-year-old woman, a friend of the victim, was also punched and pushed to the ground during the incident.

The 17-year-old was charged a public order offence, while the 16-year-old was charged with assault by beating, police said.

Prosecutor Samantha Mitchell said the boys had yelled homophobic insults like “faggot” and “queer.”

Mitchell added: “He felt a right arm around his neck, gripping really tightly, he felt like he was being strangled and was struggling to breathe.

“A male took his phone out of his hand, and another male said ‘f*cking apologise you f*cking queer’.”

Both boys apologised for the incident in court, saying they had been very drunk at the time, and had since quit drinking alcohol.

The teenagers were ordered to attend youth offender meetings for 12 months, and to pay £150 compensation each to the victims, in addition to £20 each in costs.

Magistrate Glenford Shipley-Younan warned the boys that they probably would have faced a prison sentence if they had been older.

In statements read out to the court, both victims said they felt nervous about travelling on public transport as a result of the attack, with Mayrick saying he had suffered from panic attacks.

“I don’t think I deserve to be assaulted simply for being gay, and in this day and age I would have expected society to be more accepting,” the Mayrick said.

“Hate crime will not be tolerated by British Transport Police. We believe that everyone has the right to travel safety,” police previously said in a statement.

“We won’t tolerate behaviour where someone is targeted because they are perceived to be different, or made to feel uncomfortable on their journey.”

Hate crime against LGBT+ people on public transport remains a serious issue across the UK.

In 2017, new figures by the British Transport Police highlighted hate crimes and incidents against transgender people using the rail network had risen by more than 70 percent.

Data revealed last year showed the number of attacks on lesbian, gay and bisexual people in the UK have risen by nearly 80 percent in the past four years.

The research, released by charity Stonewall, found more than one in five LGBT people have experienced a hate crime or incident due to their sexual orientation or gender identity in the year up to September 2017.

Two in five trans people have experienced a hate crime or incident because of their gender identity in the same time frame, according to the report.

More than 5,000 LGBT people in the UK were polled for the research.

Many of the incidents took place in public spaces, with 17 percent of those polled having been victims of hate crime when visiting restaurants, bars or cafes.

Another report, commissioned by Pride in London, found a 35 percent rise in reported hate crime against the LGBT+ community in London since same-sex marriage was introduced in 2014.

“Many people think that London is a progressive city, but hate is still a big problem for the LGBT+ community here,” a statement from Pride in London said.

A third of UK adults that had experienced a hate crime said they had not reported the incident to the police, with many saying they did not realise they were a victim of a crime.

Others said they did not think the report would be taken seriously.