Mr Obama pledged his commitment to Israeli security during his Sderot visit
US presidential hopeful Barack Obama has said the world must prevent Iran from obtaining a nuclear weapon.
During a two-day visit to Israel and Palestinian territories, Mr Obama warned that a nuclear-armed Iran would pose a grave threat to world security.
He held talks with Israeli and Palestinian leaders.
The Illinois senator pledged his "unshakeable commitment" to Israeli security and to peace negotiations in the Middle East.
Hosting the Democratic candidate-in-waiting for dinner, Israeli Prime Minister Ehud Olmert said Mr Obama was following a tradition of the "great friends of Israel".
"I know how friendly you are, and I know how much you care for us," he said.
'No retreat'
Mr Obama earlier said the global community should offer "big sticks and big carrots" to persuade Iran to halt its nuclear programme.
"A nuclear Iran would pose a grave threat and the world must prevent Iran from obtaining a nuclear weapon," he said.
I'm here on this trip to reaffirm the special relationship between Israel and the United States, my abiding commitment to its security
If elected, Mr Obama said he would take "no options off the table" in dealing with the Islamic republic.
Iran insists its nuclear aims are peaceful. On Wednesday President Mahmoud Ahmadinejad said Tehran would not "retreat one iota" in its nuclear activities.
Mr Obama was speaking in the Israeli town of Sderot - the target of frequent Palestinian rocket attacks from the Hamas-controlled Gaza Strip.
Mr Obama reiterated his view that Jerusalem should be Israel's capital, but insisted the city's final status must be decided through peace talks.
He angered the Palestinian leadership last month by saying the city - which Palestinians want as the capital of a future state - should be Israel's "undivided" capital.
Palestinian appreciation
Also on Wednesday, Mr Obama held talks with Palestinian leader Mahmoud Abbas in the West Bank town of Ramallah, telling him that he would quickly engage in the Middle East peace process were he elected president.
"Obama confirmed to President Abbas that he will be a constructive partner in the peace process," Palestinian spokesman Saeb Erekat told reporters.
Advertisement
Barack Obama lays holocaust wreath
Mr Obama told Israeli President Shimon Peres he wanted to "reaffirm the special relationship between Israel and the United States, [and] my abiding commitment to its security".
He said it was "my hope that I can serve as an effective partner, whether as a... senator or as a president, in bringing about a more lasting peace in the region."
Mr Obama also met Defence Minister Ehud Barak, opposition leader Benjamin Netanyahu and Foreign Minister Tzipi Livni.
At the Yad Vashem Holocaust memorial museum, the Illinois senator wore a Jewish skullcap as he laid a wreath.
"Let our children come here and know this history so that they can add their voices to proclaim 'never again'," he wrote in the museum's visitors' book.
False claims
Mr Obama is in the region to reassure American voters, especially Jewish Democrats, of his foreign policy credentials ahead of November's presidential election, says the BBC's Middle East correspondent Paul Wood.
Mr Obama said the ties between the US and Israel were unbreakable
Our correspondent also says he faces a US electorate which includes 10% who think he is a Muslim, according to a recent opinion poll.
Some also believe he was educated in a madrassa (Islamic religious school) and refused to place his hand on the Bible when sworn into the Senate - all false claims, adds our correspondent.
Mr Obama arrived in Israel on Tuesday night from neighbouring Jordan, where he met King Abdullah.
He earlier joined a US congressional delegation on a visit to Iraq, where he met Sunni tribal leaders in Anbar province and Prime Minister Nouri Maliki in Baghdad.
He repeated his goal of withdrawing US combat troops from Iraq within 16 months should he become president.
He is due to leave for Germany early on Thursday.
Back in the US, Mr McCain said Mr Obama had been wrong to press for withdrawal timetables.
Are you in Israel or the Palestinian territories? Are you following Obama's world tour?
Send your comments using the post form below, or text 61124.
The BBC may edit your comments and not all emails will be published. Your comments may be published on any BBC media worldwide.
Bookmark with:
What are these?