UNITED NATIONS — For years, diplomats were more comfortable talking about nuclear warheads than sexual orientation.

Sexual orientation was one of those subjects burdened with too many cultural sensitivities. American officials, even if they wanted to advance it on the diplomatic agenda, were wary of offending their allies, not least in the Islamic world.

The attack on a gay nightclub in Orlando, Fla., moved the needle.

In its aftermath, the United States corralled an unlikely group of countries to support a United Nations Security Council statement that condemned the attack for “targeting persons as a result of their sexual orientation.” Even Egypt and Russia — not known for embracing their gay and lesbian citizens — signed on, after what diplomats called intense consultations.

Earlier in the day, the United States delivered a pointed rebuke to countries that block gay rights at the United Nations, urging them to “contribute more than condolences and condemnations” after the Orlando attack.