Sen. Bernie Sanders (I-Vt.), who is vying for the Democratic presidential nomination, announced his support Friday for the Iran nuclear deal negotiated by President Obama, saying the pact needs “a chance to succeed.”

“The test of a great nation is not how many wars it can engage in, but how it can resolve international conflicts in a peaceful manner,” Sanders said in a statement. “This agreement is obviously not all that many of us would have liked, but it beats the alternative – a war with Iran that could go on for years.”

Sanders said he made his decision following a telephone call Friday with Obama, whom the senator said addressed some of his concerns with the deal, which Republicans and some wary Democrats on Capitol Hill are attempting to scuttle.

[By embracing Iran deal, Hillary Clinton puts herself in a sales role]

The deal has also been endorsed by the Democratic presidential frontrunner, Hillary Rodham Clinton, the former secretary of state, who took credit last month for “having been part of building the coalition that brought us to the point of this agreement.” Former Maryland governor Martin O’Malley, another Democratic hopeful, also backs the deal.

Sanders’s statement of support for Obama came a day after  Sen. Charles E. Schumer (D-N.Y.), the presumptive next Democratic leader of the Senate and the most senior Jewish member of Congress, said he would oppose the agreement, citing a concern that Iran would still be free after a decade to build a nuclear bomb. Israeli leaders have strongly condemned the pact, saying it's a threat to their country's security.

[Sen. Charles Schumer announces opposition to nuclear pact with Iran]

In his statement, Sanders credited Obama and Secretary of State John F. Kerry for having “worked through a very difficult process with the United Kingdom, France, Germany, China, Russia and Iran.”

“If Iran does not live up to the agreement, sanctions may be reapplied,” Sanders said. “If Iran moves toward a nuclear weapon, all available options remain on the table. I think it is incumbent upon us, however, to give the negotiated agreement a chance to succeed.”