* Obama: chemical arms allegations in Syria must be probed
* Says still time for diplomacy over Iran nuclear issue
* Netanyahu says Israel has right to defend itself
By Matt Spetalnick and Jeffrey Heller
JERUSALEM, March 20 (Reuters) - U.S. President Barack Obama pledged on Wednesday to hold Syria to account if it used chemical weapons and reassured Israel of U.S. resolve against Iran as he tried to allay the security fears of the main U.S. ally in the Middle East.
Obama, visiting Israel for the first time as president and seeking to bolster his image among Israelis, said he had asked for an investigation to determine if chemical weapons had been unleashed in Syria as has been alleged.
Standing alongside Israeli Prime Minister Benjamin Netanyahu, with whom he has had rocky relations, Obama expressed scepticism that Syrian rebels had launched chemical weapons and said there would be retaliation if Syrian President Bashar al-Assad had used them.
"We have been clear that the use of chemical weapons against the Syrian people would be a serious and tragic mistake," Obama said at a news conference in Jerusalem with Netanyahu.
"The Assad regime must understand that they will be held accountable for the use of chemical weapons or their transfer to terrorists," he said.
Obama also expressed a desire for a resumption of Israeli-Palestinian talks but brought no new proposals and made no mention of Israeli settlement-building, a main factor behind the collapse of the U.S.-sponsored negotiations in 2010.
He said he wanted to hear from each side before determining a way forward. He meets Palestinian President Mahmoud Abbas in Ramallah on Thursday.
Much of Obama's three-day visit to Israel is aimed at resetting relations with a valued ally that became offended during Obama's first term when he pressured Netanyahu to halt settlement construction and did not visit the Jewish state.
Displaying a markedly warmer approach toward Obama, Netanyahu said he was "absolutely convinced that the president is determined to prevent Iran from getting nuclear weapons".
However, the right-wing leader said he was certain Obama appreciated that Israel "can never cede the right to defend ourselves to others, even to the greatest of our friends", a hint at a possible go-it-alone plan to attack Iran's nuclear programme.
"Today we have both the right and the capability to defend ourselves," said Netanyahu.
Obama, whose administration has in the past privately sought to head off a unilateral military strike against Iran, said Netanyahu was "absolutely correct" that each country has the right to defend itself.
The president said there was "not a lot of daylight" between U.S. and Israeli assessments of where Iran is on its nuclear development. But he was quick to note "there is time to resolve this diplomatically".
"The question is, will the Iranian leadership seize that opportunity," Obama added.
(Writing by Steve Holland; Editing by Giles Elgood)