President Obama said Saturday that partisan wrangling over the nuclear agreement with Iran has gone beyond pale and said the harsh criticism of the deal “needs to stop.”

Obama singled out Arizona GOP Sen. John McCain for suggesting that Secretary of State John Kerry’s explanations of the framework agreement in Iran were “somehow less trustworthy” than those of Iran’s supreme leader.

"That's an indication of the degree to which partisanship has crossed all boundaries," Obama at the end of the two-day Summit of the Americas. "And we're seeing this again and again."

McCain responded late Saturday, saying, “It is undeniable that the version of the nuclear agreement outlined by the Obama administration is far different from the one described by Iran's supreme leader -- on inspections, sanctions relief and other critically important issues.

“These widely divergent explanations of the nuclear deal must be fully explained and reconciled if we are to give serious consideration to this agreement.

Obama said at the summit in Panama that he understood that people would be against the proposed deal and be suspicious of Iran.

"But when you start getting to the point where you are actively communicating that the United States government and our secretary of state is somehow spinning presentations in a negotiation with a foreign power, particularly one you say is your enemy, that's a problem," he said.

Obama also attacked Senate Majority Leader Mitch McConnell for his criticism, saying the Kentucky Republican had been “telling the world” not to have confidence that the U.S. can meet its own climate change goals.

Obama also renewed complaints about the 47 Republican senators who sent a letter to Iran’s leaders saying that any deal the Iranians made with the U.S. would not necessarily hold up after Obama has left the office.

Obama said he's still "absolutely positive" that the framework agreement is the best way to prevent Iran from getting a nuclear weapon. And he added that if the final negotiations don't produce a tough enough agreement, the U.S. can back away from it.

The president added that instead of working to make the nuclear deal better, GOP critics seemed out to sink it.

"I don't understand why it is that everybody's working so hard to anticipate failure," he said.

McCain, the Senate Armed Services Committee chairman, was among the signatories to the GOP letter to Iran's leaders warning that any deal struck with Obama would be "a mere executive agreement" that the next president could revoke. In the days since, McCain has stood by the letter's sentiment while acknowledging that writing to the leadership in Tehran had not been the most effective move. Kerry has denounced that letter as "unconstitutional."

The Senate Foreign Relations Committee is set to debate and begin voting Tuesday on amendments to legislation calling for Congress to have a say on the nuclear agreement.

Obama opposes the bill as written and has pledged to veto it, but lawmakers on both sides of the aisle have proposed numerous amendments to either make a final deal impossible to reach or to give the White House more leeway to negotiate with Iran.

Under the bill, Obama could unilaterally lift or ease any sanctions that were imposed on Iran through presidential action. But he would be prohibited for 60 days from suspending, waiving or otherwise easing any sanctions Congress levied on Iran.

The Associated Press contributed to this report.