"It's not my victory, it's yours and yours and yours," Harvey Milk said after winning a seat on the San Francisco Board of Supervisors in late 1977. "If a gay can win, it means there is hope that the system can work for all minorities if we fight. We've given them hope."

A year after delivering that speech and making history as the first openly gay elected official in California — and one of the first in the country — Milk was gunned down at San Francisco City Hall on Nov. 27, 1978. He was just 48.

But during his short time in office, Milk made his mark. He helped to pass the country’s first gay rights ordinance, which sparked the legal LGBTQ-rights revolution that has since resulted in a nationwide right to same-sex marriage and an increasing number of LGBTQ-rights protections in cities and states across the country.

Milk also undoubtedly inspired future generations of LGBTQ Americans to enter politics. Earlier this month, 40 years after his death and decades after his history-making election, a record-breaking “rainbow wave” of lesbian, gay, bisexual and transgender Americans followed in his footsteps by running for office and winning.

Harvey Milk poses in front of his camera shop in San Francisco in this Nov. 9, 1977 photo. AP file

Milk's political career started and ended in San Francisco, a city whose gay population had ballooned so much that by 1978, The New York Times estimated that up to a third of all active voters in the city were “homosexual.”

Milk, however, did not win his first campaigns for local office. Lillian Faderman, a historian and author of "Harvey Milk: His Lives and Death," said when Milk moved to the Bay Area from New York in the early 1970s, he was eager to run for office. But a Democratic official told him to wait his turn, saying, “You don’t get to dance unless you put up the chairs, and I’ve never seen you put up the chairs,” Faderman recounted in an interview with NBC News.

Faderman said "Harvey spent the next few years putting up the chairs." Milk organized a pro-gay business association and helped start the Castro Street Fair, both of which were huge successes, according to Faderman.

A Navy veteran and one-time Wall Street professional, Milk helped build a name for himself in politics not just by focusing on gay liberation, but also by addressing the most pedestrian of municipal issues: dog poop, which then littered San Francisco’s streets. Milk gained national attention when he sponsored an ordinance — still in effect today — that fined people who did not clean up after their dogs.

While Milk is today best known for his role as a gay-rights pioneer and one of the first openly LGBTQ people ever elected to public office in the U.S., Cleve Jones, an activist and a protege of Milk's, said his mentor "was never a single-issue candidate."

“He was very concerned 40 years ago about gentrification, displacement, he talked a lot about what was happening in San Francisco’s Mission District, the Latino community, during that first wave of gentrification,” Jones told NBC News. “I think he would be very concerned about income inequality, and would be the first to point out, as San Francisco demonstrates, one can have all the diversity and inclusion one can imagine, and still be ruled by oligarchs.”

Milk’s gay-rights crusade — to define and secure rights for a minority group that many people wished would sit down and keep quiet — ruffled feathers in San Francisco, which then was a city divided between neighborhoods of hippies and gays and those of working-class Catholic families. The neighborhoods represented by Milk and his killer, Dan White, represented both sides of this divide.

When Milk began to press for a city-wide ordinance to protect gay rights, his eventual killer and fellow city supervisor, Dan White, gave a quote to The New York Times, decrying the “demands” of “large minorities.” White predicted that San Francisco residents would either move out of the city or “react punitively,” the paper reported.

“Dan White ran talking to people in his district about how he would work to rid San Francisco of social deviants,” Faderman said.

Milk predicted punitive reactions to his own push for gay rights. After his death, associates released a tape recording that Milk had instructed "be played only in the event of my death by assassination."

“I fully realize that a person who stands for what I stand for, an activist, gay activist, becomes a target or the potential target for somebody who is insecure, terrified, afraid, or very disturbed themselves," Milk said on his final tape. “Knowing that I could be assassinated at any moment or any time, I feel it’s important that some people know my thoughts."