Iran's top diplomat on Monday defended his country's harsh anti-gay laws, which includes capital punishment for consensual same-sex sexual acts.

Iranian Foreign Minister Javad Zarif cited "moral principles" when asked why Iran executes homosexuals.

Zarif also decried the US and Israel for "violating human rights."

Six countries impose the death penalty for consensual same-sex sexual acts: Iran, Yemen, Saudi Arabia, Nigeria, Sudan, and Somalia.

Visit Business Insider's homepage for more stories.

Iranian Foreign Minister Javad Zarif on Monday cited "moral principles" when asked why Iran executes homosexuals for their sexual orientation, as he also attacked the US and Israel for "violating human rights."

At a press conference in the Iranian capital with his German counterpart, Heiko Maas, Zarif was asked by Bild reporter Paul Ronzheimer about the death penalty for gay people in the Middle Eastern country.

"Our society has moral principles, and according to these principles we live," Zarif responded. "These are moral principles regarding the behavior of people in general. And that's because the law is upheld and you abide by laws."

In late January, a 31-year-old man was publicly hanged in Iran after being found guilty of violating the country's anti-gay laws, according to The Jerusalem Post.

Read more: Trump's Iran strategy is failing to reduce tensions as a top general warns the threat to US troops is still 'imminent'

As of March 2019, there were 70 UN member states that have laws on the books criminalizing consensual same-sex sexual acts, according to a report from the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA). Of these countries, six impose the death penalty on consensual same-sex sexual acts: Iran, Yemen, Saudi Arabia, Nigeria, Sudan, and Somalia.

At Monday's press conference, Ronzheimer also asked where Zarif stands on Israel's right to exist.

"The problem is the aggressive policies of Israel and the USA," Zarif said. "The US and Israel are violating human rights, and the US is continuing its crimes."

"You have to ask Netanyahu," Zarif added. "Netanyahu has nuclear weapons to destroy Iran. We have not started a war and we will not do it. But if we are attacked, we will not be the ones to end this war."

This came amid heightened tensions between the US and Iran, which have sparked fears of a potential military confrontation that could spiral into a full-scale war.

Read more: Pete Buttigieg says US won't 'help foot the bill' if Israel's Netanyahu annexes West Bank settlements, setting himself apart from 2020 Democrats

As President Donald Trump left for a campaign rally in Iowa on Tuesday, he was asked if he's hopeful about the prospect of "peaceful dialogue" with Iranian leaders

"I hope that everything works out with Iran. Iran is a country that now, because of all of the sanctions and other things, is a much different country than when I came here," Trump said. "When I came here, they were all over the place causing terror, causing problems. They're not doing that right now.

"I think they respect the United States right now much more than they ever have," Trump added.