Iranian President Hassan Rouhani on Monday blamed the United States for the spread of terrorism in the Middle East, saying America's dual post-9/11 wars — and its alliance with Israel — allowed extremist ideologies to flourish.

"If we did not have the U.S. military invasion of Afghanistan and Iraq and the United States' 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," Rouhani said in a speech to the United Nations General Assembly.

President of Iran, Hassan Rouhani addresses the 70th session of the United Nations General Assembly September 28, 2015 at the United Nations in New York. DON EMMERT / AFP - Getty Images

The attack came after Rouhani spent much of his address praising the diplomacy that led to a nuclear accord between Iran and a coalition of six world powers, including the United States. He called the accord a "brilliant example of victory over war."

But Rouhani said the pact should be just a step toward a larger movement toward nuclear disarmament that will spread across the Middle East. He said Israel — which he again referred to as "the Zionist regime" — was "the only impediment" to that goal.

Rouhani's ramarks began with harsh words for Saudi Arabia, site of a stampede that killed hundreds of Muslim pilgrims — including 136 Iranians — last week at one of Islam's holiest sites.

He blamed the disaster, and the confusion that followed, on "incompetence and mismanagement of those in charge" and called for an independent investigation.