* Obama criticises settlements but urges Abbas to talk
* Palestinians feel U.S. has distanced itself from them
* Palestinians in Gaza fire two rockets into Israel
* Iranian leader threatens Tel Aviv if Israel strikes (Adds Obama quotes, Hamas spokesman, claim of responsibility for rocket attack)
By Steve Holland and Ali Sawafta
RAMALLAH, West Bank, March 21 (Reuters) - U.S. President Barack Obama voiced opposition on Thursday to Israeli settlement building but pressed Palestinian President Mahmoud Abbas to drop his demand for a freeze before Middle East peace talks can resume.
After an effusive welcome in Israel, Obama travelled to the Israeli-occupied West Bank, where disillusioned Palestinians held out little hope that their moment in the spotlight of a U.S. presidential visit would speed their quest for statehood.
At a news conference with Abbas, Obama said he had "been clear" with Israeli Prime Minister Benjamin Netanyahu that Washington did not consider continued settlement activity to be constructive to "the cause of peace".
But Obama stopped short of calling for a halt to settlement expansion - a demand he had made early in his first term - and signalled his frustration over the failure of Israel and the Palestinians to find a way to resume talks stalled since 2010.
However, he offered no new ideas on how to get Israelis and Palestinians negotiating again at a time when prospects for a peace deal are grim in a region destabilised by the West's nuclear standoff with Iran and civil war in Syria.
"My argument is even though both sides may have areas of strong disagreement, may be engaging in activities that the other side thinks is a breach of good faith, we have to push through those things to try to get an agreement," Obama said.
The core issue now, Obama said, is how to achieve sovereignty for Palestinians and security for Israelis.
"That's not to say settlements aren't important. That's to say if we solve those problems, the settlement issue will be resolved," Obama added.
Some 150 Palestinian demonstrators gathered in Ramallah to protest against Obama's visit. They were held back by ranks of police who prevented them from nearing Abbas's compound.
A smiling Obama, accompanied by Abbas, was met by mostly stern-faced Palestinian officials along a red carpet - a stark contrast to the broad grins and backslapping during an elaborate welcoming ceremony on Wednesday at Israel's Tel Aviv airport.
Obama, embarking on a second and final four-year term in the White House, has made clear he is not bringing any new peace initiatives but instead has come to Israel and the Palestinian Territories on a "listening" tour.
But he said his new secretary of state, John Kerry, would spend a significant amount of time and energy trying to narrow differences between the two sides as the United States seeks to move them back to the negotiating table.
Abbas reaffirmed his demand for a settlement freeze, but held out the prospect of a broader peace between Israel and other Arab nations if a Palestinian state was created.
"If peace came between us and the Israelis, Israel knows well that all the Arab and Islamic countries, 57 states, will recognise the state of Israel immediately," he said.
As a reminder of the ever-present risks in the region, Iranian state television quoted Supreme Leader Ayatollah Ali Khamenei as saying Tehran would raze Tel Aviv and the city of Haifa if Israel carried out veiled threats to attack Iran.
And Palestinians in the Gaza Strip fired two rockets into Sderot, a southern Israeli town that Obama visited when running for president in 2008. Police said no one was hurt.
On the Internet, a small Islamist militant group, Magles Shoura al-Mujahddin, claimed responsibility. Obama is not going to visit Gaza, which is controlled by the Islamist group Hamas, a rival to the Western-backed Abbas, who condemned the attack.
Hamas spokesman Sami Abu Zuhri said Obama's statements in Ramallah were meaningless.
"He continues to stress the American position that calls for direct negotiations without pre-conditions, which is the same position of Israel," Abu Zuhri said.
Obama held talks with Netanyahu on Wednesday and toured the Israel Museum in Jerusalem with him on Thursday, viewing the ancient Dead Sea Scrolls - artefacts that underscore the Jewish link to the Holy Land - and a high-tech exhibit.
The main focus of his initial discussions with Netanyahu appeared to be pressing regional concerns, primarily Iran's nuclear ambitions and the civil war in neighbouring Syria, and winning the hearts of a sceptical Israeli public.
After repeated run-ins with Netanyahu during Obama's first term in office, the mood between the two men appeared to be much warmer, angering Palestinians, who blame the 2010 collapse of U.S.-backed peace negotiations on the Israeli leader's expansion of settlements on land where they want their state.
Obama is also to address the decades-old conflict later on Thursday in a keynote speech to students in Jerusalem.
After the lofty ambitions of Obama's first term, when he appointed a special envoy to the Middle East on his very first day in charge and said peacemaking was a priority, it was clear that the president has now set the bar significantly lower.
"I will consider this a success if, when I go back on Friday, I am able to say to myself I have a better understanding of what the constraints are," he told a joint news conference on Wednesday, standing alongside Netanyahu.
The three-day visit is Obama's first to Israel and the West Bank since entering the White House in 2009, and the inaugural foreign trip of a final four-year term that began in January.
Sporadic protests had flared in the West Bank and Gaza Strip this week, with Palestinians accusing Obama of not doing enough to halt Israeli settlement-building on land seized in 1967.
Posters depicting the U.S. president were defaced in the West Bank cities of Ramallah and Bethlehem earlier this week and anti-U.S. sentiment bubbled up on social media. (Additional reporting by Noah Browning in Ramallah, Nidal al-Mughrabi in Gaza and Matt Spetalnick, Allyn Fisher-Ilan and Crispian Balmer in Jerusalem; Editing by Jeffrey Heller and Giles Elgood)