President Obama reportedly penned a secret letter to Iran's Supreme Leader Ayatollah Ali Khamenei last month discussing their shared interest in fighting the Islamic State -- a development one congressional source told Fox News "f***s up everything."

The Wall Street Journal reported Thursday that, according to people briefed on the letter, Obama wrote to Khamenei in the middle of last month and stressed that any cooperation on dealing with the Islamic State, or ISIS, was tied to Iran striking a deal over its nuclear program. The U.S., Iran and other negotiators are facing a Nov. 24 deadline for such a deal.

A senior congressional source told Fox News that there is not anything definitive as to whether the letter even exists. But the source indicated they don't doubt that it's true because "we've seen [the president] do it before, so there is [a] precedent."

According to the Journal, Obama has written to Khamenei four times now since taking office.

The congressional source told Fox News that the letter would upset the inroads they've tried to make with "the Sunni league," noting that the president should have informed Congress of this back-channel if it was in fact going on.

More On This...

"This f***s up everything," the source said.

Iran's government is Shiite-led, while the Islamic State is a Sunni terror group. The source was apparently referring to efforts to rally support among Sunni-led Arab states to confront ISIS.

Republican Sens. John McCain of Arizona and Lindsey Graham of South Carolina issued a joint statement Thursday night saying it was "outrageous that, while the cries of moderate Syrian forces for greater U.S. assistance fall on deaf ears in the White House, President Obama is apparently urging Ayatollah Khamenei to join the fight against ISIS."

Asked about the reported letter, White House Press Secretary Josh Earnest would not confirm the report.

"I'm not in a position to discuss private correspondence between the president and any world leader," he said.

However, he said the U.S. policy toward Iran "remains unchanged."

"The United States will not cooperate militarily with Iran in that effort [against ISIS]. We won't share intelligence with them," he said. "But their interests in the outcome is something that's been widely commented on ... and something that on a couple of occasions has been discussed on the sidelines of other conversations."

Fox News' Chad Pergram contributed to this report.