Elton John and his longtime boyfriend, David Furnish, entered a civil partnership on Dec. 21, 2005, in England under a law the country had just enacted granting recognition to same-sex couples. The congratulations poured in as the two men appeared at a joyous ceremony at Windsor Guildhall, amid a crush of paparazzi. Donald Trump, who had known the couple for years, took to his blog to express his excitement.

"I know both of them, and they get along wonderfully. It's a marriage that's going to work," Trump wrote, adding: "I'm very happy for them. If two people dig each other, they dig each other."

Trump is now the leading candidate for president in the Republican primary, which has traditionally been dominated by candidates eager to show how deeply conservative they are on social issues like gay rights and marriage.

But Trump is far more accepting of sexual minorities than his party's leaders have been. On Thursday, he startled some Republicans by saying on NBC's "Today" show that he opposed a recently passed North Carolina law that prohibits people from using public bathrooms that do not correspond to the gender they were born with, striking down a Charlotte ordinance.

Transgender people should "use the bathroom they feel is appropriate," Trump said, putting him at odds with a majority of Republicans in North Carolina.

But it is his views on gay rights and gay people that most distinguish Trump from previous Republican standard-bearers. He has nurtured long friendships with gay people, employed gay workers in prominent positions, and moved with ease in industries where gays have long exerted influence, like entertainment.

"He will be the most gay-friendly Republican nominee for president ever," said Gregory T. Angelo, president of Log Cabin Republicans, a group that supports gay rights.

'It's only fair'

Of course, Trump is not as embracing of gay rights as the Democratic candidates are; he said during this campaign that he believes that marriage is between a man and a woman, a position he has held since at least 2000, when he briefly flirted with a bid for the presidency. But he does not emphasize marriage as an issue, and he makes no mention of it on his campaign website, which focuses on issues like immigration and trade.

And Trump, who has inflamed tensions with groups from Hispanics to women to African-Americans, has avoided attacking or offending gay men and lesbians during the campaign.

His history with the gay community is a long one. He donated to charities focused on the AIDS crisis in the late 1980s and early '90s. In 2000, when he briefly considered running for president, he gave an interview to The Advocate, a gay magazine, in which he supported amending the Civil Rights Act of 1964 to "include a ban of discrimination based on sexual orientation."

"It would be simple. It would be straightforward," Trump said in the interview. "It's only fair."

Sixteen years later, gay rights advocates are still trying to persuade Congress to pass a similar measure, but they have struggled to win support, especially from Republicans. The last Republican nominee, Mitt Romney, opposed similar legislation in 2012.

Trump declined to be interviewed for this article.

His ease with gay people does not seem to be the result of deep soul searching but, rather, the product of the Manhattan social and political world he has inhabited the past five decades.

"I live in New York. I know many, many gay people. Tremendous people," Trump said in an interview in 2011.

He has been playful at times, such as in 2000, when he and Mayor Rudy Giuliani appeared in a skit for a political roast, during which Trump nuzzled and caressed the mayor, who was dressed in drag.

Friends say he also views gay rights through the lens of a bottom-line-minded businessman.

"His key concern is, 'Are you capable and able to do the job I hired you for?' And if you are, very little else matters," said Abe Wallach, an openly gay executive at the Trump Organization in the 1990s. "Very little on a social level will make Donald excited - if it was money or something else, he might get excited."

Trump was believed to be the first private club owner in Palm Beach, Fla., to admit an openly gay couple, according to Laurence Leamer, the author of "Madness Under the Royal Palms," a book about Palm Beach society. Trump made his club, Mar-a-Lago, more open partly out of disdain for the restrictions that barred Jews and African-Americans from joining exclusive clubs in Palm Beach.

"It's one of the best things he's done, in my view, in his life," Leamer said. "He really changed the nature of Palm Beach."

Conservative alliances

Rand Hoch, a gay activist who founded the Palm Beach County Human Rights Council in 1988, recalled bringing dates to Mar-a-Lago on two occasions. Both times, he said, Trump, who loves to greet guests as they arrive at his club, was pleasant and approached the two for chitchat.

"He treated us no differently than everyone else who was going through that door," Hoch said, adding that it was not possible that Trump was unaware they were gay. "He's perceptive, so I'm pretty sure he didn't think we were brothers."

Wallach said that he and his husband would fly on Trump's jet to Florida or Atlantic City on weekends. "I found him to be very friendly to my spouse," he said. "He would often ask about my spouse, how his dental practice was doing."

Trump's foundation has given over the years to groups like the AIDS Service Center and the Elton John AIDS Foundation. Some of those donations came more recently in connection with his reality television show "The Celebrity Apprentice," whose winners got to select the recipient charities.

But as early as 1987, Trump made a $25,000 contribution to the Gay Men's Health Crisis, from profits generated by his company's operation of the Wollman Memorial Rink in Central Park. And in 1992, the Trump Taj Mahal held an event that raised $60,000 for AIDS research.

Trump's recent alliances with social conservatives such as Jerry Falwell Jr. and Pat Robertson have alarmed people like Angelo, whose group, the Log Cabin Republicans, is eager to meet with the real estate mogul to discuss his positions in detail.