GREENSBORO, N.C. — In his first campaign rally since the massacre at a gay nightclub in Orlando, Fla., Donald J. Trump again attempted to portray himself as a better friend of L.G.B.T. Americans than Hillary Clinton, in part because of his opposition to immigration from Middle Eastern countries.

“We want to live in a country where gay and lesbian Americans and all Americans are safe from radical Islam,” Mr. Trump said, “which, by the way, wants to murder and has murdered gays and they enslave women.”

As he did on Monday, Mr. Trump claimed Mrs. Clinton’s immigration policies would open the floodgates to jihadists, pointing to her plan to increase the number of Syrian refugees admitted to the country by 550 percent over President Obama’s plan.

“We don’t know who they are, where they’re coming from, there’s no documentation,” Mr. Trump said. (Mrs. Clinton’s plan does call for more refugees from Syria, but also intense vetting processes, of which one is already in place.)

“Crooked Hillary wants to increase these immigration numbers very, very substantially,” he said. “She’s no friend of women. And she’s no friend of L.G.B.T. Americans. No friend, believe me.”

In the past, Mr. Trump has been more accepting of sexual minorities than his party’s leaders have been, but his particular emphasis on gay and lesbian communities and calls to embrace them, even shrouded in caustic comments toward Middle Eastern immigrants, was notable in North Carolina, which is the epicenter of the debate over transgender bathrooms. (It should be noted that Mr. Trump still opposes same-sex marriage.)

Mr. Trump said in April that transgender people should “use the bathroom they feel is appropriate,” but later said the issue should be “left up to the states.”

Mr. Trump later recalled a story accusing soldiers of skimming money in Iraq, also notable in North Carolina, a state home to Fort Bragg.

“Iraq, crooked as hell,” Mr. Trump said, at the tail end of his normal screed about ISIS controlling some of the “highest grades of oil” in the world.

“How about bringing baskets of money, millions and millions of dollars and handing it out. I want to know who are the soldiers that had that job because I think they’re living very well right now, whoever they may be.”

His campaign said he was referring to Iraqi soldiers, although previous reports had found that some U.S. soldiers were convicted of bribery and fraud. It was an accusation Mr. Trump, who has made support for veterans such a key part of his campaign, has levied before, but never as the presumptive Republican nominee, and one who has made support for veterans such a key part of his campaign.

But as he sought to shore up support in the wake of the tragedy in Orlando, Mr. Trump continually emphasized his anti-immigration proposals.

“Every year we bring in more than 100,000 lifetime immigrants from the Middle East, and many more from Muslim countries outside of the Middle East,” he said. “A number of these immigrants have hostile attitudes.”

He said that his stand was a major reason for the support he has received.

“We’ve admitted four times more immigrants than any other country in the world,” Mr. Trump said. “We can’t do this. Not surprisingly, wages for people working in our country, real wages, real numbers, haven’t increased for 18 years.”

He added: “And then they wonder why I have packed houses all over the place.”

Those in the crowd were mixed on Mr. Trump’s plan on immigration. Nancy Alford, 51, from Greensboro, said that it was a “very sensitive issue” but that she wanted everyone to be treated and vetted equally.

Others thought Mr. Trump didn’t go far enough.

“They need to round them up and let them get out of the country,” said Lance Shafley, 61, of Liberty, N.C., who also referred to “camps” from World War II. “This country is at war against ISIS and the hostile Muslims.”