(Adds Obama quotes, reaction)
By Jeff Mason and Julia Edwards
WASHINGTON, July 14 (Reuters) - President Barack Obama heralded a nuclear agreement with Iran on Tuesday as an opportunity to shift direction in the Middle East, and warned he would veto any attempt by deeply skeptical Republican lawmakers to overturn the deal.
Obama, relishing a foreign policy win that fulfilled a campaign promise dating back to 2008, said the pact cut off every pathway for Iran to get an atomic bomb.
"After two years of negotiations, the United States, together with our international partners, has achieved something that decades of animosity has not: a comprehensive, long-term deal with Iran that will prevent it from obtaining a nuclear weapon," he said during an early morning address.
"I believe it would be irresponsible to walk away," Obama said.
Under the deal, formally announced in Vienna where the talks were held, sanctions imposed by the United States, European Union and United Nations will be lifted in exchange for Iran agreeing to long-term curbs on a nuclear program that the West and Israel have suspected was aimed at creating a nuclear bomb.
Obama said the agreement was based on verification, not trust, but it ran into a storm of criticism from Republican lawmakers and presidential candidates who said it gave too much away to Tehran.
"Instead of making the world less dangerous, this 'deal' will only embolden Iran," said House Speaker John Boehner.
U.S. Senate Majority Leader Mitch McConnell, also a Republican, said the deal appeared to retain "flawed" elements of its temporary predecessor, and Republican Senator Bob Corker, chairman of the Senate's Foreign Relations Committee, vowed a rigorous review.
U.S. lawmakers have the right to study the pact and could sink it with a disapproval resolution that would eliminate Obama's ability to waive sanctions passed by Congress.
But Obama had a clear message for Republican lawmakers considering that option. "I will veto any legislation that prevents the successful implementation of this deal," he said.
Hillary Clinton, Obama's former secretary of state and the 2016 Democratic presidential frontrunner, called the deal an "important step," but said enforcement would be crucial.
Obama had promised as a presidential candidate to reach out to U.S. foes if he won the White House, drawing criticism from opponents including Clinton, who at the time was his rival for the 2008 Democratic presidential nomination.
Obama said Washington would maintain sanctions on Tehran over its support for terrorism, its ballistic missile program and its human rights violations.
He also sought to reassure Israeli Prime Minister Benjamin Netanyahu, a strident critic of the agreement, in a call on Tuesday. Obama is sending U.S. Defense Secretary Ash Carter to Israel next week in a show of solidarity.
"They have clear differences about this deal, there's no question about that," an administration official said of Obama and Netanyahu, whose testy relationship was further strained earlier this year when the Israeli leader addressed Congress about Iran.
There are also clear differences remaining with Iran.
A U.S. official said Secretary of State John Kerry urged his counterpart, Iranian Foreign Minister Mohammad Javad Zarif, on Tuesday to release American citizens being held in Iran.
But Obama said the deal was a chance for change in the region.
"Our differences are real and the difficult history between our nations cannot be ignored. But it is possible to change," he said. "This deal offers an opportunity to move in a new direction. We should seize it." (Additional reporting by Matt Spetalnick and Patricia Zengerle, editing by G Crosse)