John Kerry suggested today that the task of defeating the Islamic State could fall to Iran and the Syrian government if the US was "failing miserably" in its effort to defeat the jihadists.

The hypothetical scenario raised by the secretary of state is likely to be a new frustration for the White House, which has spent the day quashing speculation by American generals that US ground troops could be sent back to Iraq.

Mr Kerry's words may also heighten Sunni suspicions that the US secretly intends to ally with the Shia governments in Damascus and Tehran against Isil.

Mr Kerry made the suggestion as he faced hostile questions from Republicans during a hearing of the Senate foreign relations committee.

He was asked by Marco Rubio, a hawkish Republican, whether American combat forces could be deployed to the Middle East if commanders deemed it was necessary for defeating Isil.

Mr Kerry repeated President Barack Obama's pledge not to deploy ground troops under any circumstances but then raised the prospect of Iranian and Syrian intervention.

"I'm not going to get into hypotheticals but you're presuming that Iran and Syria don't have any capacity to take on Isil. I mean, who knows? I don't know what's going to happen here," he said. "If we're failing and failing miserably who knows what choice they're might make."

Here's the full exchange, beginning with Mr Rubio suggesting there may come a point where US ground troops are needed:

Rubio: The reason this isn’t a hypothetical is there may come a point where what you’re saying is the only thing that can solve this problem is US combat forces and we are not going to do that and Isil gets to stay.

Kerry: But I think that we are so far away from that "being the only way" and being a hypothetical.

Rubio: Well let me ask you this-

Kerry: No, let me just finish the question. I’m not going to get into hypotheticals but you’re presuming Iran and Syria don’t have any capacity to take on ISIL, I mean who knows. I don’t know what’s going to happen here. Let’s start down this road-

Rubio: Let me ask you about that then. What you’re saying now is there is the potential for the US will be coordinating with Iran?

Kerry: No I never said anything about coordinating. If we are failing and failing miserably who knows what choice they might make.

The US has insisted that it will not coordinate militarily with either Assad or the Iranians.

But this week Iran's supreme leader, Ayatollah Ali Khamenei, claimed that the US had privately approached Tehran seeking cooperation against Isil. He rejected the approach, saying the US had "corrupt intention and stained hands".

The US has not denied making the request in private.