JERUSALEM (AP) — Eager to reassure an anxious ally, President Barack Obama on Wednesday promised to work closely with Israel and do whatever is necessary to keep Iran from obtaining nuclear arms, ‘‘the world’s worst weapons.’’ He also pledged to investigate whether chemical weapons were used this week in neighboring Syria’s two-year-old civil war.
Obama, meeting with Israeli Prime Minister Benjamin Netanyahu on his first visit to the Jewish state as president, said of Iran’s nuclear ambitions: ‘‘We prefer to resolve this diplomatically and there is still time to do so.’’ But he added that ‘‘all options are on the table’’ if diplomacy falls short.
‘‘The question is, will Iranian leadership seize that opportunity,’’ he added. The president said Iran’s past behavior indicates that ‘‘we can’t even trust yet, much less verify.’’
Netanyahu, at Obama’s side for a joint news conference, said that while he appreciated US efforts to thwart Iran’s pursuit of nuclear weapons through diplomacy and sanctions, those tools ‘‘must be augmented by a clear and credible threat of military action.’’
‘‘I am absolutely convinced that the president is determined to prevent Iran from getting nuclear weapons,’’ Netanyahu said. ‘‘I appreciate that. I appreciate the fact that the president has reaffirmed, more than any other president, Israel’s right and duty to defend itself by itself against any threat.’’
The Israeli leader said that he and Obama agree that it would take Iran about a year to manufacture a nuclear weapon. Obama said there is ‘‘not a lot of light, a lot of daylight’’ between the two leaders in intelligence assessments about Iran, and Netanyahu concurred.
Although preventing Iran from developing a nuclear weapon is a priority of both Israel and the United States, Netanyahu and Obama have differed on precisely how to achieve that.
Israel repeatedly has threatened to take military action should Iran appear to be on the verge of obtaining a bomb. The US has pushed for more time to allow diplomacy and economic penalties to run their course, though Obama insists military action is an option.
Obama also took note of the difficult way forward in the broader quest for Mideast peace, acknowledging that in recent years ‘‘we haven’t gone forward, we haven’t seen the kind of progress that we would like to see.’’
The president said he came to the region principally to listen, and hoped to return home with a better understanding of the constraints and ‘‘how the US can play a constructive role.’’
‘‘This is a really hard problem,’’ he declared.
Netanyahu, for his part, said he was willing to set aside preconditions in future talks with the Palestinians, adding that it was time to ‘‘turn a page in our relations.’’
On another troubling issue in the region, Obama said the US is investigating whether chemical weapons have been deployed in Syria, and he said he was ‘‘deeply skeptical’’ of contentions by Syrian President Bashar Assad’s government that rebel forces were behind any such attack.
Both the Assad government and Syrian rebels have accused each other of using chemical weapons in an attack on Tuesday.
Obama said the US policy not to intervene militarily or arm Syrian rebels thus far is based on his desire to solve the problem with world partners.
‘‘It’s a world problem when tens of thousands of people are being slaughtered, including innocent women and children,’’ Obama said.
Obama’s visit to Israel, from the start, has been designed to send a message of reassurance to a key ally.
At an extravagant welcoming ceremony, Obama sounded a message that ‘‘peace must come to the Holy Land’’ and that such a goal could not be achieved at Israel’s expense. US backing for Israel will be a constant as the Middle East roils with revolution and Iran continues work on its nuclear program, he said.
‘‘The United States is proud to stand with you as your strongest ally and your greatest friend,’’ Obama said after landing at Tel Aviv’s Ben Gurion International Airport.
‘‘Across this region the winds of change bring both promise and peril,’’ he said, calling his visit ‘‘an opportunity to reaffirm the unbreakable bonds between our nations, to restate America’s unwavering commitment to Israel’s security, and to speak directly to the people of Israel and to your neighbors.’’
Seeking to alter a perception among many Israelis that his government has been less supportive of Israel than previous US administrations, Obama declared the US-Israeli alliance ‘‘eternal.’’
‘‘It is forever,’’ he said to applause as Israeli and US flags fluttered in a steady breeze under clear, sunny skies.
Even before leaving the airport for Jerusalem, Obama offered a vivid display of the US commitment to Israeli security by visiting a missile battery that is part of Israel’s Iron Dome defense from militant rocket attacks. The United States has invested hundreds of millions of dollars in developing the system with Israel.
Obama and Netanyahu toured the battery, brought to the airport for the occasion. They met and chatted with soldiers who operate the system that Israel credits with intercepting hundreds of rockets during a round of fighting against Gaza militants last November.
Netanyahu, who sparred frequently with Obama over the course of the US president’s first term, praised the president.
‘‘Thank you for standing by Israel at this time of historic change in the Middle East,’’ he said. ‘‘Thank you for unequivocally affirming Israel’s sovereign right to defend itself by itself against any threat.’’
Obama, who joked that he was ‘‘getting away from Congress’’ by visiting Israel, planned to visit several cultural and religious sites aimed at showing his understanding of the deep and ancient connections between the Jewish people and the land that is now Israel.
He will also meet Palestinian Authority President Mahmoud Abbas in the West Bank and travel to Jordan before returning home on Saturday.
Even though US officials have set expectations low and previewed no major policy pronouncements, a clear measure of the success of Obama’s Israel trip will be how much he is able to reverse negative perceptions.
The centerpiece of the visit will be a speech to Israeli university students on Thursday, during which Obama will again renew US security pledges as Israel seeks to counter threats from Iran, protect its people from any spillover in the Syrian civil war and maintain its shaky peace accord with an Egypt that is now controlled by the Muslim Brotherhood.
Obama will visit the cash-strapped Palestinian Authority’s headquarters in the West Bank town of Ramallah, where he will meet the embattled Abbas and assure him that an independent Palestinian state remains a US foreign policy and national security priority.
As Israelis warmly greeted Obama, Palestinians held several small protests in the West Bank and Gaza. Demonstrators in the Hamas-ruled Gaza Strip burned posters of Obama and US flags, accusing the US of being biased toward Israel.
In the West Bank, about 200 activists erected about a dozen tents in an area just outside of Jerusalem to draw attention to Israel’s policy of building settlements. The tents were pitched in E1, a strategically located area where Israel has said it plans on building thousands of homes. The US has harshly criticized the plan.
Obama will close out his Mideast trip with a 24-hour stop in Jordan, an important US ally, where his focus will be on the violence in Syria. More than 450,000 Syrians have fled to Jordan, crowding refugee camps and overwhelming aid organizations.
In his talks with Jordan’s King Abdullah, Obama also will try to shore up the country’s fledgling attempts to liberalize its government and stave off an Arab Spring-style movement similar to the ones that have ousted leaders elsewhere in the region.
Associated Press writers Mohammed Daraghmeh in Ramallah, West Bank, and Ibrahim Barzak in Gaza City, Gaza Strip, contributed to this report.