Jim Mattis says he hasn't thought about becoming commander in chief, but he has thought about what the next president needs to focus on to keep America safe.

"The Iranian regime, in my mind, is the single most enduring threat to stability and peace in the Middle East," the retired Marine Corps general warned during a Washington, D.C. speech on Friday.

"For all the talk of ISIS and Al Qaida everywhere right now… they're a very serious threat. But nothing is as serious in the long term enduring ramifications, in terms of stability and prosperity and some hope for a better future for the young people out there, than Iran."

The event, held by the Center for Strategic and International Studies, came amid speculation of a possible forced third party run by Mattis, the former head of U.S. Central Command and a cult hero among among many military members.

Mattis has expressed no interest in such a run and again dismissed the idea on Friday — "I haven't thought about it" — and dismissed questions about his opinions on the current presidential field.

But he also spent almost an hour taking the campaign tack of blasting the White House and Congress, this time for inaction on the topic of Iran and failing to prepare for more instability in the Middle East.

"Among all the issues facing us in the Middle East, I think Iran is actually foremost," he said. "And yet at the same time, it appears here in Washington that we've forgotten how to keep certain issues foremost."

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

He criticized President Barack Obama for being naive about Iranian intentions and Congress for being "pretty much absent" on last year’s nuclear deal. He even took an indirect shot at this year’s Republican presidential frontrunner, saying he assumed an insensitive comment directed at U.S. foreign allies must have come from Donald Trump.

Mattis offered little praise for the nuclear deal, saying it's far from "a friendship treaty," but also dismissed Republican claims that the international agreement should be torn up by the next president.

"We are going to have to recognize that we have an imperfect arms control agreement," he said. "What we achieved was a nuclear pause, not a nuclear halt. We're going to have to plan for the worst."

Mattis said that includes a recognition that Iran will never be a "modern, responsible" influence in the Middle East, and its power must constantly be kept in check.

He also predicted the Iranian government will be top U.S. security threat for decades to come.

"In the Middle East, the future is going to be ghastly," he said. "We know that vacuums left in the Middle East seem to be filled by either terrorists or by Iran or their surrogates or Russia … In order to restore deterrence, we have to show capability, capacity and resolve."

Mattis, who spent almost two years overseeing U.S. military operations in the Middle East, said Obama did not make a mistake trying to engage with Iran, especially given how close the country was to building a nuclear weapon. Military action would have delayed that process only a year or two, he argued. Diplomacy has probably delayed it at least a decade.

"But the mistake was to take our eye off the ball afterward," he said.

Leo Shane III covers Congress, Veterans Affairs and the White House for Military Times. He can be reached at lshane@militarytimes.com.