On the final night of the Republican National Convention, Donald Trump made history with an explicit pledge to protect LGBTQ people during his speech accepting the GOP presidential nomination.

Trump made the remarks while invoking the mass shooting last month at a gay nightclub in Orlando, saying the 49 left dead at the hands of a shooter who pledged allegiance to Islamic extremists were “wonderful Americans.”

“Only weeks ago, in Orlando, Fla., 49 wonderful Americans were savagely murdered by an Islamic terrorist,” Trump said. “This time, the terrorist targeted the LGBTQ community. No good, and we’re going to stop it. As your president, I will do everything in my power to protect our LGBTQ citizens from the violence and oppression of a hateful foreign ideology. Believe me.”

The audience at the Quicken Loans Arena applauded those words, a stark contrast to the Republican National Convention in 1992 when attendees chanted “Family Rights Forever/Gay Rights Never” during a speech delivered by anti-gay conservative leader Pat Buchanan.

In response to the applause, Trump ad-libbed: “And I have to say, as a Republican, it is so nice to hear you cheering for what I just said. Thank you.”

Those words mark the first time a Republican presidential nominee invoked the LGBT community in a positive way during an acceptance speech at a GOP convention. In 2012, then-Republican presidential nominee Mitt Romney took the opportunity of his acceptance speech to “honor the institution of marriage” at a time when the LGBT community was seeking the legalization of gay nuptials.

Ric Grenell, a gay Fox News commentator and delegate from California pledged to Trump, told the Washington Blade on the floor of the Quicken Loans Arena he doesn’t think “anybody is surprised” by Trump’s inclusion of LGBT people in his acceptance speech.

“Trump has always made perfectly clear that he has a lot of gay friends, that he is totally for equality,” Grenell said. “And for me, it’s actually, I know we have a lot of work to do within the Republican Party on gay rights, but it’s really emotional for me to be here on my seventh convention.”

Recalling being present in 1992 listening to Buchanan, Grenell said, “To be here and to really see the acceptance, we made dramatic progress in four years. I just think it’s time that the gay left leadership in Washington, D.C. realize that we can remove this issue from being a partisan issue.”

But Trump’s pledge to protect LGBT people against terrorism stands in contrast to positions on LGBT rights he has staked out on the campaign trail.

Related: Day Four: Thiel Declares ‘I am Proud to be Gay’ at GOP Convention

Although Trump hasn’t had as much vitriol for LGBT people as he has had for other minority groups, Trump has told social conservatives to “trust” him to oppose same-sex marriage, said he would “strongly consider” appointing U.S. Supreme Court justices who would reverse marriage equality and offered conditional support for the First Amendment Defense Act, a federal “religious freedom” bill that would enable anti-LGBT discrimination.

Moreover, Trump delivered the LGBT-inclusive speech in the same week delegates at the Republican National Convention ratified a party platform considered the most anti-LGBT in history. Among other things, the platform seeks to overturn the Supreme Court decision for same-sex marriage through either judicial reconsideration or a constitutional amendment.

On Twitter, Hillary Clinton pointed out when Trump thanked his audience for supporting LGBT inclusion in his speech the Republican platform indicates support for widely discredited “ex-gay” conversion therapy.

Later in his speech, Trump undercut his goodwill toward the LGBT community by recommitting himself to appointing conservative justices — a move critics contend could led to a reversal of the Supreme Court’s decision on same-sex marriage.

Related: Undocumented Immigrant: Trump, GOP Platform Could 'Incite' Violence

“We are also going to appoint justices to the United States Supreme Court who will uphold our laws and our Constitution,” Trump said. “The replacement of our beloved Justice Scalia will be a person of similar views, principles and judicial philosophy. This will be one of the most important issues decided by this election.”

Trump also singled out evangelical Christians — a group that has historically opposed the LGBT community — to thank them for helping him win the Republican presidential nomination, saying, “the support they’ve given me, and I’m not sure I totally deserve it, has been so amazing, and has been such a big reason why I’m here tonight.”

To assist the evangelical community, Trump said he’d “work very hard” to repeal the 1954 Johnson Amendment, which prohibits tax-exempt organizations from endorsing or opposing political candidates. Undoing that language would “protect free speech for all Americans,” Trump said.

Trump also stoked fears about undocumented immigrants in the United States.

Related: Caitlyn Jenner Denounces Anti-Trans Bills at ‘Big Tent’ Event

“Of all my travels in this country, nothing has affected me more deeply than the time I have spent with the mothers and fathers who have lost their children to violence spilling across our border,” Trump said. “These families have no special interests to represent them. There are no demonstrators to protest on their behalf. My opponent will never meet with them, or share in their pain.”

Invoking the names of individuals who were allegedly killed by undocumented immigrants in “sanctuary cities,” Trump renewed his pledge to build a wall on the U.S.-Mexico border and said Clinton wants to pursue a policy that amounts to “mass amnesty, mass immigration and mass lawlessness.”

“We are going to build a great border wall to stop illegal immigration, to stop the gangs and the violence and to stop the drugs from pouring into our communities,” Trump said.

Chad Griffin, president of the Human Rights Campaign, pointed out on Twitter Trump’s attacks on other minority groups are still attacks on LGBT people. 

Trump’s pledge to build a wall along the U.S.-Mexico border was apparently the source of ire for a “Code Pink” protester who made it into the Quicken Loans Arena with a banner reading, “Build Bridges Not Walls.” As she was being escorted out, Trump said, “How great are our police and how great is Cleveland?”

But the newly anointed Republican presidential nominee generally strived for a tone of inclusion throughout his speech. Although he maintained his priority would be “struggling citizens,” he said he’d be “considerate and compassionate to everyone.”

Related: ‘Gays for Trump’ Denounce ‘Radical Islam’

Introducing him on stage was his daughter Ivanka Trump, who made the case her father would champion gender equality.

“There have always been men of all backgrounds and ethnicities on my father’s job sites and long before it was commonplace you also saw women,” Ivanka Trump said. “My father values talent. He recognizes real knowledge and skill when he finds it. He is colorblind and gender-neutral. He hires the best person for the job.”

Closing his speech, Trump returned to the slogan that helped propel him to the Republican nomination.

“So to every parent who dreams for their child, and every child who dreams for their future, I say these words to you tonight: I’m with you, I will fight for you, and I will win for you,” Trump said. “To all Americans tonight, in all of our cities and in all of our towns, I make this promise: We Will Make America Strong Again. We Will Make America Proud Again. We Will Make America Safe Again. And We Will Make America Great Again.”