BERLIN — The Trump administration is launching a global campaign to end the criminalization of homosexuality in dozens of nations where it's still illegal to be gay, U.S. officials tell NBC News, a bid aimed in part at denouncing Iran over its human rights record.

U.S. Ambassador to Germany Richard Grenell, the highest-profile openly gay person in the Trump administration, is leading the effort, which kicks off Tuesday evening in Berlin. The U.S. embassy is flying in LGBT activists from across Europe for a strategy dinner to plan to push for decriminalization in places that still outlaw homosexuality — mostly concentrated in the Middle East, Africa and the Caribbean.

“It is concerning that, in the 21st century, some 70 countries continue to have laws that criminalize LGBTI status or conduct,” said a U.S. official involved in organizing the event.

Although the decriminalization strategy is still being hashed out, officials say it’s likely to include working with global organizations like the United Nations, the European Union and the Organization for Security and Cooperation in Europe, as well as other countries whose laws already allow for gay rights. Other U.S. embassies and diplomatic posts throughout Europe, including the U.S. Mission to the E.U., are involved, as is the State Department’s Bureau of Democracy, Human Rights and Labor.

Narrowly focused on criminalization, rather than broader LGBT issues like same-sex marriage, the campaign was conceived partly in response to the recent reported execution by hanging of a young gay man in Iran, the Trump administration’s top geopolitical foe.

Grenell, as Trump’s envoy to Germany, has been an outspoken Iran critic and has aggressively pressed European nations to abandon the 2015 nuclear deal and re-impose sanctions. But while the Trump administration has had some success in pressuring Iran through stepped-up U.S. penalties, efforts to bring the Europeans along have thus far largely fallen flat.

Reframing the conversation on Iran around a human rights issue that enjoys broad support in Europe could help the United States and Europe reach a point of agreement on Iran. Grenell called the hanging “a wake-up call for anyone who supports basic human rights,” in Bild, a leading German newspaper, this month.

“This is not the first time the Iranian regime has put a gay man to death with the usual outrageous claims of prostitution, kidnapping, or even pedophilia. And it sadly won’t be the last time,” Grenell wrote. “Barbaric public executions are all too common in a country where consensual homosexual relationships are criminalized and punishable by flogging and death.”

He added that “politicians, the U.N., democratic governments, diplomats and good people everywhere should speak up — and loudly.”

Yet by using gay rights as a cudgel against Iran, the Trump administration risks exposing close U.S. allies who are also vulnerable on the issue and creating a new tension point with the one region where Trump has managed to strengthen U.S. ties: the Arab world.

In Saudi Arabia, whose monarchy Trump has staunchly defended in the face of human rights allegations, homosexuality can be punishable by death, according to a 2017 worldwide report from the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA). The report identified 72 nations that still criminalize homosexuality, including eight where it’s punishable by death.

That list includes the United Arab Emirates, Pakistan and Afghanistan — all U.S. allies — although those countries aren’t known to have implemented the death penalty for same-sex acts. In Egypt, whose leader Trump has effusively praised, homosexual relations aren’t technically illegal but other morality laws are used aggressively to target LGBT people.

New U.S. pressure on those countries to change their laws comes as the Trump administration is working to use nascent ties between Arab nations and Israel to form a powerful axis against Iran, a strategy that dovetails with the administration’s planned rollout of an ambitious plan for Israeli-Palestinian peace.

In the Gulf state of Oman, for example, the Trump administration has touted a recent, historic visit by Israeli Prime Minister Benjamin Netanyahu as a sign that old taboos are eroding. But any campaign to decriminalize homosexuality would ostensibly also have to call out Oman, where prison sentences can be handed out for being gay.

The push to end laws that outlaw homosexuality abroad also stands in contrast to the Trump administration’s mixed record on gay rights at home.

As a candidate, Trump was ambiguous about his position on many gay rights issues, but notably became the first Republican nominee to mention LGBT rights in his acceptance speech at the Republican National Convention. His convention also featured another first: PayPal founder Peter Thiel became the first gay person to acknowledge his sexuality in a speech to the GOP convention, declaring he was “proud to be gay.”

Trump, after being elected, also said he was “fine” with same-sex marriage. But since he took office, his administration has scaled back some workplace protections for gay people and has argued in court that a federal anti-discrimination law doesn’t protect gay employees. He has also announced a ban on transgender people serving openly in the U.S. military, which the Supreme Court last month said could be implemented even as lower-court challenges play out.

U.S. officials said Secretary of State Mike Pompeo is supporting the work by U.S. embassies and consulates to fight violence and discrimination against LGBT people. In his Senate confirmation hearing, Pompeo asserted: “I deeply believe that LGBTQ persons have every right that every other person in the world would have.”

Grenell, known for his hawkish views on national security, is also currently under consideration to be Trump’s ambassador to the U.N., three U.S. officials tell NBC News, after Trump’s previous pick for the job, Heather Nauert, withdrew from consideration over the weekend. Grenell once served as spokesman for the U.S. ambassador to the U.N. when that role was inhabited by John Bolton, who is now Trump’s national security adviser.

Planning for the campaign to decriminalize homosexuality started before the U.N. job became open. It was a topic of conversation over the weekend at the Munich Security Conference, where Grenell discussed it with a visiting congressional delegation that included Sen. Lindsey Graham, R-S.C.; Sen. Chris Coons, D-Del.; and Rep. Sheila Jackson Lee, D-Texas.

Despite the dozens of countries that still outlaw homosexuality, LGBT rights have proliferated in recent years in many parts of the world. Two dozen countries now recognize same-sex marriage, according to the ILGA report, while another 28 recognize domestic partnerships. The last U.S. laws outlawing same-sex activity were invalidated by the Supreme Court in 2003 in Lawrence v. Texas.

Grenell, in his editorial in Bild, pointed out that India, Belize, Angola, and Trinidad and Tobago recently decriminalized same-sex conduct among consenting adults. But he said “reasonable people” must keep speaking out about laws in other places, including Iran and Chechnya, the Russian region where authorities have cracked down violently on gay people in recent years.

“While a student at Evangel University, a Christian liberal arts college in Missouri, I was taught by biblical scholars that all truth is God’s truth, no matter where it is found. The truth for LGBT people is that we were born gay,” Grenell wrote. “People can disagree philosophically about homosexuality, but no person should ever be subject to criminal penalties because they are gay.”