While she’s best known for her legendary entertainment career, Madonna was celebrated on Saturday not for her musical accomplishments, but for her decades of activism on behalf of the LGBTQ community — from the height of the HIV/AIDS crisis to present-day anti-gay political policies.

“No single ally has been a better friend or had a bigger impact on acceptance for the LGBTQ community than Madonna,” CNN anchor Anderson Cooper said in his introductory remarks at the 30th Annual GLAAD Media Awards, where the pop icon was honored with the Advocate for Change Award.

At the height of the evening, amid a packed, cheering midtown Manhattan ballroom, Madonna took the stage and delivered an emotional acceptance speech.

“Fighting for all marginalized people is a duty and an honor I could not turn my back on nor will I ever,” she told the primarily LGBTQ audience.

She dedicated a significant portion of her heartfelt speech to the early days of HIV/AIDS crisis in the 1980s, which marked a time of painful loss for her personally and the beginning of her LGBTQ advocacy.

“The AIDS epidemic, the plague that moved in like a black cloud in New York City, and in the blink of an eye,” she snapped her fingers, “took out all of my friends.”

“I remember the pandemonium and the fear, and people trying all kinds of drugs that didn’t work,” she continued. “And doing my own drug runs to Mexico for my friends to buy experimental medicines that were supposed help cure, but ended up only killing them faster.”

She recalled visits to sick friends in the ‘80s at St. Vincent’s Hospital, ground zero for New York City’s AIDs epidemic.

“It felt like I had entered a concentration camp,” she said. “Emaciated bodies in every bed, and all these people who had been abandoned by their families and their friends and their loved ones. I decided to defy the universe and get into every bed and put my arms around as many humans as I could and make them feel loved — and human.”

She wished her late friend, the artist Keith Haring, a happy 51st birthday. Haring died in 1990 at the age of 31 from an AIDS-related illness. She also told the story of her first dance teacher and mentor, Christopher Flynn. He was the first gay man she had ever met, and he, too, succumbed to AIDS in 1990.

“He was my ballet teacher in high school, and he was the first person that believed in me,” she said, “that made me feel special as a dancer, as an artist and as a human being. I know this sounds trivial and superficial, but he was the first man to tell me that I was beautiful.”

During her approximately 15-minute speech, Madonna also spoke about her humanitarian efforts in Africa, the 50th anniversary of the 1969 Stonewall rebellion, visiting her first gay club in downtown Detroit and her own feelings of being an outsider.

In closing, she said, “As soon as you really understand what it means to love, you understand what it takes to become a human being, and that it is every human’s duty to fight, to advocate, to do whatever we can and whatever it takes.”

Following her on-stage remarks, NBC News asked Madonna what or whom she is most focused on fighting against now. After a long pause, she looked down toward the ground, sighed, and then held her head high and said, “Sexism, ageism, people discriminating against me because I am a strong independent female who has chosen an unconventional life and has made an unconventional family.”

“The fact that I continue to be adventurous and mischievous and creative, it is almost like a crime to a lot of people. Like, how dare you? And why do you keep doing it?” she explained. “I am 100 percent sure people wouldn’t say that to me if I was a man. That is a big part of my fight now.”

Madonna is only the second recipient of GLAAD’s Advocate for Change Award. The first was former President Bill Clinton in 2013. He was honored, according to GLAAD, “for his advocacy work to overturn the anti-LGBTQ Defense of Marriage Act and advance marriage equality nationwide.”

In a statement shared with NBC News following Saturday’s ceremony, GLAAD President and CEO Sarah Kate Ellis said Madonna “always has and always will be the LGBTQ community’s greatest ally.”

“From the HIV crisis to international LGBTQ issues, she fearlessly pushes for a world where LGBTQ people are accepted,” Ellis stated. “Her music and art have been life-saving outlets for LGBTQ people over the years and her affirming words and actions have changed countless hearts and minds.”

Madonna will release her 14th studio album, titled “Madame X,” globally on June 14. She released a single from the album, “I Rise,” on Friday, which she said she wrote “as a way of giving a voice to all marginalized people who feel they don’t have the opportunity to speak their mind.”

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM