The top prize at the MTV Video Music Awards was won by Lil Nas X for his track Montero (Call Me By Your Name).

Accepting the prize, the delighted rapper, 22, said: "First, I want to say thank you to the gay agenda! Let's go, gay agenda!"

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Lil Nas X was up against Cardi B, Megan The Stallion, Justin Bieber, Drake, Doja Cat, Ed Sheeran and The Weeknd for the award.

The video for Montero (Call Me By Your Name) features the musician sliding down a pole into hell before giving the devil a lap dance.

The star, who has emerged as a vocal advocate for LGBT rights, used a performance during the VMAs to raise awareness of HIV in the southern states of the US.

He stripped down to a pair of sparkling pink briefs while surrounded by similarly dressed backing dancers for a medley of Industry Baby and Montero (Call Me By Your Name).

The annual ceremony brought some of the biggest names in pop to the Barclays Centre in New York City, with Justin Bieber, Ed Sheeran and the Foo Fighters among a star-studded list of performers.

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Elsewhere, it was a night to remember for pop prodigy Olivia Rodrigo.

At her first VMAs, the 18-year-old was named Best New Artist and won Song of the Year for her mega hit Drivers License.

Rodrigo, a Disney Channel actress whose debut album Sour topped the charts in the UK and US earlier this year, writes her own music.

Accepting song of the year, Rodrigo thanked her army of fans and said: "This has been the most magical year of my life and it’s all because of you."

She added: "I want to dedicate this award to all the other girls who write songs on their bedroom floor.

"There are a lot of people who will try to dim your light but speaking your mind and sharing your heart are the most beautiful things in the world and here’s to that."

Justin Bieber was named Artist of the Year.

Taking to the stage, the Canadian superstar said "we are in unprecedented times" due to the pandemic.

He said: "Music is such an amazing opportunity and an amazing outlet to be able to reach people and to be able to bring us all together and that’s why we’re here right now. We’ve got a lot more in common than we don’t."

Bieber, who paid tribute to his "beautiful" wife Hailey who was seated in the audience, added: "I really do believe the best is yet to come."

As well as joy for Rodrigo, there was also recognition for another pop sensation.

Billie Eilish, 19, won the fan-voted video for good award for Your Power, a song about an older man abusing his position over a younger woman.

Accepting the prize, Eilish said: "We need to protect our young women at all costs, for real."

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Doja Cat and SZA won best collaboration for their sensual summer hit Kiss Me More while superstars BTS were awarded Best K-pop for Butter.

They could not attend the ceremony and shared a video acceptance speech.

Rockers Foo Fighters performed a medley of songs and picked up the first-ever Global Icon Award.

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Also among the performers were pop couple Camila Cabello and Shawn Mendes.

Machine Gun Kelly and Travis Barker closed proceedings after being introduced by their respective girlfriends, Megan Fox and Kourtney Kardashian.

Fox, Kelly’s partner, brought them to the stage by describing the rockers as "our future baby daddies".

Alicia Keys delivered a tribute to New York City on the weekend marking the 20-year anniversary of the 9/11 terror attacks.

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

She performed her track Empire State Of Mind, a love letter to her hometown.

The evening took a political turn when presenter Cyndi Lauper referenced her song Girls Just Wanna Have Fun while apparently taking aim at a controversial law in Texas banning most abortions.

As well as fun, Lauper said, women also want "control over our bodies … you know, fundamental rights".

The statement was met with rapturous applause by the audience.

Here are the main winners from the MTV Awards 2021:

Video of the year – Lil Nas X (Montero (Call Me By Your Name))

Artist of the year – Justin Bieber

Best new artist – Olivia Rodrigo

Song of the year – Olivia Rodrigo (Drivers License)

Push performance artist of the year – Olivia Rodrigo

Best pop – Justin Bieber, Giveon, Daniel Caesar (Peaches)

Video for good – Billie Eilish (Your Power)

Best hip hop – Travis Scott featuring M.I.A. and Young Thug (Franchise)

Best collaboration – Doja Cat featuring SZA (Kiss Me More)

Best K pop – BTS (Butter)

Group of the year – BTS

Song of summer – BTS (Butter)

VMA global icon award – Foo Fighters

Best alternative – Machine Gun Kelly featuring Blackbear (My Ex's Best Friend)

Best R&B – Bruno Mars and Anderson .Paak (Leave The Door Open)

Best rock – John Mayer (Last Train Home)