NEW YORK – The video of the year trophy was the final memorable moment of a night full of them for Justin Timberlake at the MTV Video Music Awards.

Timberlake won the top honor for “Mirrors” on the same night he reunited briefly with ‘N Sync and received the Michael Jackson Vanguard Video Award on Sunday as the awards debuted in Brooklyn.

Macklemore & Ryan Lewis were the night’s other top winners, taking home best hip-hop video for “Can’t Hold Us” and best video with a social message for “Same Love,” a marriage equality anthem. Other winners included Taylor Swift, One Direction, Bruno Mars, Selena Gomez and Thirty Seconds to Mars.

Timberlake, dressed in a black suit and black hat with a red feather, powered through a breathless series of solo hits before the other four members of ‘N Sync — JC Chasez, Chris Kirkpatrick, Joey Fatone, and Lance Bass — joined him on stage, opening with “Bye Bye Bye.”

“Half of the moonmen I’ve ever won, I won with those four guys right there,” Timberlake said pointing at his former bandmates while holding the Vanguard trophy. “So above all else, I’m going to share this — we can keep it my house — but I’m going to share this award with them.”

Up till then, the ladies of pop music dominated as a scantily clad Miley Cyrus became the rare artist to upstage Lady Gaga. But Swift managed to take the spotlight from both after appearing to utter an expletive when One Direction and rumored former love interest Harry Styles appeared at Sunday night’s award show — a moment that lit up Twitter.

She also thanked a former beau for helping her win another moonman trophy for “I Knew You Were Trouble” in the best female video category.

“I also want to thank the person who inspired this song, who knows exactly who he is, because I got one of these,” Swift said. “Thank you so much!”

Gaga changed costumes four times during her first return to the stage since hip surgery as she performed her new single “Applause” at the top of the show. It was a predictably unpredictable appearance for Gaga, who seemed to pump in boos over the over the sound system as she opened the song in a white nun’s habit and square headdress.

By the time she finished the song, she was surrounded by unitard-clad male dancers and wearing a thong bikini decorated in shells and a long blonde wig.

Cyrus immediately kicked things up well beyond provocative, however, as she appeared on stage with a multitude of dancing teddy bears in a bodysuit adorned with a cartoon character. She twerked to her song “We Can’t Stop,” changed into a nude bikini, ran a fan’s foam finger along her privates as Robin Thicke appeared on stage to perform “Blurred Lines,” then gave the singer a lap dance.

“Miley better go get a pregnancy test after all that grinding,” comedian Kevin Hart joked afterward.

Kanye West continued his stark portrayal of new music from his album “Yeezus,” performing “Blood on the Leaves” with its controversial Nina Simone “Strange Fruit” sample in silhouette in front of a black and white picture of a tree.

Macklemore & Ryan Lewis were the early leaders, taking best hip-hop video for “Thrift Shop” and best video with a social message for their song “Same Love,” which espouses marriage equality.

“Gay rights are human rights,” Macklemore said during the telecast. “There is no separation.”

Other early winners included Pink and Nate Ruess for best collaboration, Thirty Seconds to Mars for best rock video and Selena Gomez for best pop video. And Swift wasn’t the only one with a strong reaction to One Direction – cheers mixed with boos as they won song of the summer for “Best Song Ever.”