Image copyright Reuters

US President Barack Obama has pledged to stand by his Gulf allies with military force if necessary, amid heightened tensions with Iran.

He reassured Arab leaders, after a two-day summit, that the US was committed to protecting them in a time of "extraordinary changes".

Speaking at Camp David near Washington, Mr Obama said a nuclear deal with Iran was not a threat to Gulf nations.

A joint statement pledged new co-operation in many areas.

These included counterterrorism, maritime security, cyber-security and ballistic missile defence.

The six-nation Gulf Co-operation Council (GCC) is made up of Bahrain, Kuwait, Oman, Qatar, Saudi Arabia and UAE.

Image copyright AP

"I was very explicit ... that the United States will stand by our GCC partners against external attack,'' Mr Obama pledged at the end of the talks.

The president said he hoped that working together would help achieve "the kind of peace and good neighbourliness with Iran" that the nations present sought.

Analysis: Barbara Plett Usher, BBC News, Washington DC

President Obama didn't give the Arabs the formal defence treaty some of them wanted.

But he went as far as he felt he could to reassure them that the US had their back, including a pledge of deeper military co-operation to counter what he called Iran's destabilising activities.

Significantly for Mr Obama, the Gulf nations said a nuclear deal with Iran would be in their security interests, if it was comprehensive and verifiable.

Such public support might make it a bit easier for the president to sell an Iranian agreement to a sceptical Congress.

So everyone got something of what they needed out of the summit, but fundamental differences remain over how they view Iran, and those will continue to play out.

Calming Arab fears

The joint statement said that in the face of any aggression, the US would stand with the Arab nations "to determine urgently what action may be appropriate, using the means at our collective disposal, including the potential use of military force, for the defence of our GCC partners".

Gulf nations have grown distrustful of the White House since Mr Obama's initially sympathetic response to the Arab uprisings, and are frustrated with his reluctance to get more involved in the Syria conflict, says the BBC's Barbara Plett Usher.

They are deeply wary about any nuclear detente with Iran amidst an increasingly sectarian contest for regional dominance between Sunni Arabs and Shia Tehran, our correspondent says.

They fear the lifting of sanctions would empower Iran to increase its support for armed Shia groups in Syria, Iraq, Lebanon and Yemen, she adds.

In a reminder of the tensions, as the summit concluded, in the Gulf the Iranian navy fired warning shots at a Singapore-flagged tanker.

Saudi Arabia's foreign minister told reporters Iran's actions were a clear violation of international law.