President of Iran Hassan Rouhani addresses the United Nations General Assembly in New York on Monday. (Spencer Platt/Getty Images)

Iranian President Hassan Rouhani on Monday offered to help root out terrorism in the Middle East and said the United States and its support for Israel are a major cause of the violence.

Rouhani told the U.N. General Assembly that terrorists excuse their brutality as a reaction to military interventions and occupations by what he termed “newcomers” to the region.

“If not for the U.S. military invasion of Afghanistan and Iraq, and its unwarranted support for the inhumane actions of the Zionist regime against the oppressed nation of Palestine, today the terrorists would not have an excuse for the justification of their crimes,” he said.

Rouhani’s speech was closely watched because it was his first address to the world body since Iran finished a landmark nuclear agreement with the United States and five other nations. He said the deal, finalized in July, marked a “new chapter” in Iran’s dealings with the world, so his swipe at the United States was striking.

Rouhani said the United States and its allies in the region — an apparent reference to Israel and the Sunni Muslim states in the Persian Gulf — “only cultivate the seeds of extremism and division.”

“This must be brought to an end and its actions must be made compatible with the realities of the region,” he said.

Rouhani also called for a nuclear-free Middle East and asked the world “not to allow the Zionist regime to remain the only impediment in the way of realizing this important initiative.”

He said Iran is prepared to help bring democracy to Syria and Yemen. “The gravest threat to the world today is for terrorist organizations to become terrorist states,” he said.

There was no immediate reaction to Rouhani’s remarks from the State Department, which lists Iran as a state sponsor of terrorism.

Rouhani’s U.N. speech reprised the themes he raised during three meetings he held over the weekend with journalists, Iranian Americans and scholars who specialize in the Middle East.

At an event for academics Sunday evening, Rouhani spoke for almost 90 minutes, answering questions submitted in writing ahead of time. He sat in front of a spray of red and white flowers at a long table, next to Foreign Minister Mohammad Javad Zarif, who negotiated the nuclear agreement under which Iran will curtail its nuclear program in exchange for an easing of sanctions.

“Iran is committed to its full implementation, and will remain so,” Rouhani said. He characterized some congressional predictions that Iran will cheat and use the money it gets when assets are unfrozen under the deal to create mayhem in the Middle East as “comedic” and “false.”

“We are not a threat or danger to other countries,” he said.

Rouhani planned to fly back to Tehran immediately after finishing his U.N. speech, canceling a news conference scheduled for Tuesday. The Iranian mission to the United Nations said he was heading home “due to the tragic events at this year’s Hajj.”

Last week, a stampede at the annual pilgrimage to Mecca killed at least 769 worshipers. Many of the casualties were Iranians, with at least 170 confirmed dead and hundreds more unaccounted for.

Rouhani began his U.N. speech with blistering words for Saudi Arabia, saying the dead “fell victim to the incompetence and mismanagement of those in charge.” Saudi Arabia has opened an inquiry and has promised that anyone found at fault will be held accountable.

Rouhani’s early departure closes off any possibility that he will meet with family members of three Iranian Americans who are imprisoned in Iran. In recent days, Rouhani repeatedly has said he would try to secure their release if the United States would agree to free 19 Iranians who are imprisoned in the United States for violating sanctions.

Naghmeh Abedini said she wanted to speak to Iranian officials about her husband, Saeed Abedini, a pastor from Boise, Idaho, who was accused of opening home churches in Iran. He has served three years of an eight-year sentence on charges of undermining Iran’s national security.

Abedini said her husband’s father visited his son in prison this week and learned that Iranian authorities have threatened to bring more charges against Saeed involving alleged cooperation with anti-government groups.

She said she was disappointed that she never received a response to her request to speak with Iranian officials in New York.

Ali Rezaian also got no response when he tried to speak to the Iranian mission about his brother, Jason Rezaian, a Washington Post reporter who has been imprisoned 14 months and is awaiting a verdict on espionage and related charges. But he watched Rouhani’s speech carefully.

“The basis of his speech at the U.N. was about compassion, mercy and international law,” Ali Rezaian said. “They’ve shown none of that in Jason’s case. The right thing to do is admit Jason is innocent and let him go.”

Abedini said she is not convinced that Iran will ever free her husband, Rezaian and the other imprisoned American, former Marine Amir Hekmati.

“Not until they’re on American soil can I trust what they say,” she said. “My husband is not collateral. He’s a husband, a father, and he’s broken no law. They’re trying to barter his exchange for 19 criminals. It’s unbelievable. The Iranian government is no different than the government that held Americans hostage in the 1970s.”

Read more:

Putin vs. Obama and the other main storylines at the U.N. General Assembly

Russia’s move into Syria upends U.S. plans

Rouhani, meeting editors, hopes for better U.S. relations