US president Barack Obama has achieved perhaps the greatest foreign policy victory of his six years in office, with a Republican-backed effort to kill the Iran nuclear agreement being narrowly blocked in the US Senate.

Forty Democrats and two independents voted to block a resolution disapproving of the pact in the 100-member chamber, one more than the minimum needed to keep it from advancing.

"This vote is a victory for diplomacy, for American national security, and for the safety and security of the world," Mr Obama said in a statement after a vote he termed "an historic step forward".

But Senate Republicans insisted the fight was not over.

Majority leader Mitch McConnell immediately took steps to clear the way for the chamber to consider the matter again, hoping some Democrats would vote differently next time.

"We'll revisit the issue next week and see if maybe any folks want to change their minds," he said in a speech angrily denouncing the vote.

Under a law Mr Obama signed in May, Congress has until September 17 to pass a resolution disapproving of the international agreement.

If such a resolution were to pass, and survive Mr Obama's promised veto, it would bar the president from waiving many US sanctions on Tehran, a key component of the nuclear deal.

But there was no sign any votes would change, and Senate Democratic leader Harry Reid bluntly responded: "This matter is over with."

Senator Reid urged Senator McConnell to move on to other legislation, including bills providing long-term highway and transportation funding and urgent legislation to fund the government in the fiscal year beginning October 1 and avoid a government shutdown.

"This is a situation where he's [McConnell] lost the vote and it's a situation where he is just not in touch with reality as it exists," Senator Reid said.

The defeat came despite an intense $US40 million lobbying campaign against the agreement, largely by conservative pro-Israel groups.

Although the nuclear deal was reached after two years of negotiations with Iran by the US, Britain, France, Germany, Russia and China, the government of Israeli prime minister Benjamin Netanyahu vociferously opposed the agreement.

Mr Netanyahu said the deal demanded too little from Iran in exchange for sanctions relief and would strengthen a country he sees as a threat to Israel's existence.

Reuters