LOS ANGELES: Taylor Swift made history early Tuesday as the first woman to win the top Grammy twice, but rapper Kendrick Lamar took home five awards and delivered an electrifying, politically charged performance that rocked the gala.

The top prizes on the music industry’s biggest night mainly went to mainstream chart-toppers, with Swift taking the Album of the Year prize for “1989” and the retro party anthem “Uptown Funk” winning Record of the Year.

Swift, who has transformed from country prodigy to pop superstar, won three prizes on the night, all for work off “1989,” which was one of the best-selling US albums of the past decade.

The 26-year-old, who has fashioned herself as a feminist campaigner, spoke to her legions of girl fans as she accepted her second Album of the Year award.

“I want to say to all the young women out there — there are going to be people along the way who will try to undercut your success or take credit for your accomplishments or your fame,” Swift said.

“But if you just focus on the work and you don’t let those people sidetrack you, someday when you get where you are going, you will look around, and you will know that it was you and the people who love you who put you there,” she said.

While Swift won the top award, the most Grammys went to Lamar, whose album “To Pimp a Butterfly” offered an innovative meditation on race relations with infusions of jazz and spoken word.

Lamar, whose song “Alright” has become an unofficial anthem for protesters against police abuse, took five awards out of 11 nominations — the most nods for a single artist in one night since Michael Jackson earned 12 following his massive “Thriller.”

Meghan Trainor, 22, won another key award, Best New Artist, after the breakthrough success of “All About That Bass,” her tongue-in-cheek doo wop take on weight struggles and self-acceptance.

The Grammys also paid tribute to a number of artists who recently died — chief among them the rock icon David Bowie.

Lady Gaga appeared to transform on stage into Bowie, her face merging into his thunderbolt logo, against a three-dimensional backdrop of space imagery befitting the Starman.

Other performers included British singer Adele, whose album “25” has smashed early sales records but came out too early for Grammys contention.

Adele sang her powerful new ballad “All I Ask,” although her performance was marred by a technical glitch when a microphone fell and she drifted out of tune.

One non-performer was the R&B superstar Rihanna, who canceled at the last minute, citing voice problems due to illness.