President Obama’s effort to build broad international support to destroy the Islamic State erupted Monday in a long-distance dispute between the United States and Iran's Ayatollah Ali Khamenei over the fading prospect of Iranian cooperation. 

The dispute, amid Secretary of State John Kerry's meeting in Paris with world leaders to shore up international support, appeared to start Monday morning when Khamenei, Iran’s supreme leader, said on Twitter he has rejected a U.S. offer to help thwart the terror group and his country declined an invitation to take part in the Paris meetings.

“I reject US offer to #Iran abt #ISIS because US has corruption on its hands in this issue,” Khamenei wrote in one of several tweets.

State Department spokeswoman Jen Psaki promptly responded with a statement that acknowledged U.S. and Iranian officials had talked on the sidelines of a recent United Nations meeting about Iran dismantling its nuclear-enrichment program.

“It is not a secret that we have had discussions with Iran about the counter-ISIL efforts in Iraq on the margins of our P5+1 talks on the nuclear issue,” she said. However, Psaki also argued the U.S. never considered military efforts against Islamic State that would include Iran -- which has a long, strained relationship with the U.S.

“We are not and will not coordinate militarily,” Psaki said, while leaving open the possibility of future sideline discussions when nuclear talks resume later this week in New York. 

Iran was not invited to the Paris meetings because King Abdullah of Saudi Arabia and top United Arab Emirates officials said they would not attend if Iran was there, according to The New York Times.

However, diplomats from other countries pledged to fight Islamic State militants -- entrenched in Iraq and Syria -- "by any means necessary."

The question of Iran's involvement, as well as the Syrian government's, has complicated efforts to rally a coalition to defeat the Islamic State. President Obama called for such a coalition last week when he announced the U.S. will increase targeted airstrikes against Islamic State positions in Iraq and could do the same in Syria. Obama stressed he wants coalition support, which would include Iraqi ground troops fighting the Islamic State, also known as ISIS.

An American official said Sunday that several Arab countries had offered to conduct airstrikes, speaking on condition of anonymity to discuss the sensitive issue. No public commitments were made on Monday.

Gulf states, particularly Saudi Arabia and the United Arab Emirates, have some of the region's best-equipped militaries, and they could theoretically provide air support to a broader international coalition. U.S. officials say the Emirates and Egypt were behind airstrikes against Islamist militants in Libya last month.

The 75-year-old Khamenei, meanwhile, was released Monday from a hospital after undergoing prostate surgery.

He also said on state television that his government privately refused American requests for cooperation against the Islamic State group, warning that another U.S. incursion would result "in the same problems they faced in Iraq in the past 10 years."

Kerry said the U.S. won't shut the door on the possibility of working with Iran against a common enemy in the Islamic State, but the two nations won't coordinate on military action.

On Sunday, he also made clear the U.S. would not coordinate with Syria.

However, he also said the U.S. would want to “deconflict” with Syrian leader Bashar Assad before launching airstrikes inside that country on Islamic State targets, suggesting some type of arrangement.

White House Press Secretary Josh Earnest on Monday attempted to clarify Kerry’s remark by saying: “The U.S. is not coordinating with the Assad regime regarding contingency plans.”

Earnest also said the U.S. and Iran have “good reason” to talk about the Islamic State because it is a shared threat. And he left open the possibility of “back channel conversations” next week in New York.

State Department spokeswoman Marie Harf said later Monday there’s a “good chance” such talks might occur, but “we are not going to be coordinating with Iran.” 

Aside from the tense negotiations over Iran's nuclear program, Tehran and Washington have been at odds for decades. In November 1979, a Muslim revolutionary group, upset that Iran’s recently deposed shah was allowed into the United States, took over the American embassy in Tehran and held 52 diplomats for 444 days.

President George W. Bush in 2002 said Iran was part of an “Axis of Evil” that threatened the U.S.

The Associated Press contributed to this report.