President Obama on Friday brushed aside claims that he's neglected the U.S.-Israel relationship, and said that he and his government have done more than any other administration keep Israel safe.

"I can say that no U.S. president, no administration, has done more to ensure that Israel can protect itself," Obama said at the Adas Israel Congregation in Washington, D.C.

Obama has been criticized for allowing the bilateral relationship to deteriorate, and for negotiating a nuclear agreement with Iran that Israeli Prime Minister Benjamin Netanyahu has rejected as a plan that will guarantee Iran eventually develops a nuclear weapon. But Obama rejected those assertions, and said repeatedly that he will do anything it takes to stop Iran from acquiring those weapons.

"There's something else that the United States and Israel agrees on," he said. "Iran must not, under any circumstances, be allowed to get a nuclear weapon."

"I made clear that when it comes to preventing Iran from getting a nuclear weapon, all options are and will remain on the table," he added.

Obama went on at length about the commitment he has to protecting Israel, and said, "those bonds, that friendship, cannot be broken."

"It would be a moral failing of the U.S. government and the American people, it would be a moral failing on my part, if we did not stand up, firmly, steadfastly, not just on behalf of Israel's right to exist, but its right to thrive and prosper," he said.

Obama seemed to bristle at the idea that because the U.S. and Israel disagree on how the agreement is progressing, that this somehow means the relationship is fraying. He said Israel inspired him personally when he was a younger man.

"So when I hear some people say that disagreements over policy belie a general lack of support for Israel, I must object, and I object forcefully," he said.

Additionally, he said papering over disagreements is not an option for the two countries. "That's not a true measure of friendship," he said.

The president also pressed his preferred solution for peace in the Middle East, which is a separate state for the Palestinians.

"And I believe that's two states for two people, Israel and Palestine living side by side in peace and security," he said on what he sees as the best answer. "Just as Israelis built a state in their homeland, Palestinians have a right to be a free people on their land as well."

But Obama acknowledged, "That's not easy."

"The Palestinians are not the easiest of partners," he said. "The neighborhood is dangerous, and we cannot expect Israel to take existential risks with their security, so that any deal that takes place has to take into account the genuine dangers of terrorism and hostility."