Democratic presidential contender Barack Obama said Wednesday that Jerusalem will be Israel's capital but that the issue should be settled through negotiations with the Palestinians.

In June, Obama upset some Palestinians when he said Jerusalem would be the Israeli capital and "must remain undivided," -- a point of contention he avoided on Wednesday.

"(Jerusalem is an) issue that has to be dealt with the parties involved, the Palestinians and the Israelis, and it is not the job of the United States to dictate the form in which that will take, but rather to support the efforts that are being made right now to resolve these very difficult issues that have a long history," Obama said during a press conference in Israel.

Obama is on the latest leg of an international tour which has already taken him to Afghanistan, Iraq and Jordan.

In his speech Wednesday, Obama assured Israelis he supported the country's right to defend itself. But he noted that it is in Israel's interest to work towards a lasting peace with Palestinians.

He told Israelis he has an "unshakeable commitment to Israel's security" and said a nuclear-armed Iran would be a threat to the U.S. and Israel. Obama reiterated his support for well-prepared diplomatic talks with Tehran without preconditions.

Obama tours Holocaust memorial

Obama toured Israel's Holocaust memorial after meeting with Israeli and Palestinian officials earlier in the day.

He wore a white skullcap as he laid a wreath in memory of the six million Jews killed by Germans during the Second World War.

"I am always taken back to sort of the core question of humanity that the Holocaust raises," he said.

"That is, on the one hand, man's great capacity for evil, and on the other hand, our ability to stop evil."

The Illinois senator is trying to boost his foreign policy credentials during his whirlwind international tour. His latest stop is also an effort to build support among American Jewish voters -- many of whom have questioned his commitment to Israel.

CTV's Middle East Bureau Chief Janis Mackey Frayer, reporting Wednesday from Jerusalem, said there is a degree of wariness among Israelis and Palestinians towards Obama.

She said Israelis want to make sure Obama is a friend of Israel.

"They want to know that if Barack Obama is elected president he will hold firm against a country like Iran, which Israel believes poses a threat to its existence," said Frayer.

Obama began his day with a breakfast meeting with Israeli Defence Minister Ehud Barak. After breakfast, he met with opposition leader Benjamin Netanyahu.

Obama was also warmly received by Israeli President Shimon Peres who said his greatest wish was for a "great president of the United States."

Obama also met with Palestinian leaders, including President Mahmoud Abbas.

With files from The Associated Press