JERUSALEM (CNN) -- U.S. President Barack Obama visited the West Bank on Thursday, stressing the need for direct talks between Israelis and Palestinians for a two-state solution.
"The Palestinian people deserve an end to occupation and the daily indignities that come with it," Obama said at a news conference with Palestinian President Mahmoud Abbas.
"Palestinians deserve a future of hope," he said. "Palestinians deserve a state of their own."
The trip to the West Bank capital of Ramallah comes on the heels of Obama's visit with Israeli Prime Minister Benjamin Netanyahu, where the two leaders found common ground on issues such as Iran's nuclear progress and Israel's right to defend itself.
Obama said he and Abbas discussed, among other things, settlements and the issue of Palestinian prisoners. He reiterated that "we cannot give up on the search for peace, not matter how hard it is" to end the longtime deadlock over an Israeli-Palestinian peace agreement.
"As I said with Prime Minister Netanyahu yesterday, we will continue to look for steps that both Israelis and Palestinians can take to build the trust and the confidence upon which lasting peace will depend," he said.
Obama called for shunning the old habits, arguments and formulas that have stymied the peace process and envisioned "two nations, two neighbors at peace, Israel and Palestine."
"If we can get direct negotiations started again, I believe that the shape of a potential deal is there. And if both sides can make that leap together, then not only do I believe that the Israeli people and the Palestinian people would ultimately support it in huge numbers, but I also think the world and the region would cheer," Obama said.
The core issues right now, Obama said, are achieving sovereignty for Palestinians and security for Israel.
"And that's the essence of this negotiation. And that's not to say settlements are not important. It is to say that if we solve those two problems, the settlement problem will be solved. So I don't want to put the cart before the horse. I want to make sure that we are getting to the core issues and the substance."
Obama stressed the challenges for peace posed by Jewish settlements in the West Bank.
"It has been the United States' policy, not just for my administration, but for all preceding administrations. We don't consider settlement activity to be constructive, to be appropriate, to be something that can advance the cause of peace," Obama said.
He praised the Palestinian Authority in the West Bank, hailing its progress -- citing growing government transparency and improved security.
But he said Hamas, which governs Gaza, "has the responsibility to prevent" violations of a cease-fire with Israel, such as the firing of two rockets Thursday morning from Gaza into southern Israel.
The present cease-fire after last year's fighting between Israel and Hamas militants, he said, protects both Israelis and Palestinians.
"It would be easy for (Israel) to say, 'You see, this is why we can't have peace, because we can't afford to have kids sleeping in their beds and suddenly a rocket comes through the roof,'" Obama said.
Abbas: Peace is 'inevitable'
Abbas said that his meeting with Obama in Ramallah was "an opportunity to focus on our side" of what he said are the risks that Israeli settlements represent to a two-state solution, and on Palestinians' desire for Israel to release Palestinian prisoners.
Abbas said that settlements are "more than a hurdle to peace." He said settlements and settlement activity are illegal and it is the duty of Israel to at least stop the activity. He added that the Israeli government should listen to people in Israel critical of the settlements.
Palestinians believe peace "is necessary and inevitable," Abbas said, and it should not be made through violence, occupation, walls, denial of refugee rights or settlements -- reciting a list of Palestinian grievances against Israel.
Abbas envisioned a Palestinian state based on 1967 borders, with Jerusalem as capital.
"I hereby assert again that we are ready to implement all our commitments and obligations, and to respect the signed agreements and the international legitimacy resolutions in order to provide for the requirements of launching the peace process and achieving the two-state solutions, Palestine and Israel," Abbas said.
The sticky topic of settlements
In his first term, Obama got off to a rocky start with Netanyahu by pushing for a freeze on Israeli settlements.
The sticky topic of settlements never came up at the Wednesday news conference by Obama and Netanyahu, showing the sensitivity of the issue.
While Obama was in Jerusalem on Wednesday, Palestinian activists erected a tent city outside Jerusalem in the West Bank to protest his visit and continued Israeli construction of settlements in the West Bank.
The trip to Israel Wednesday was Obama's first since he became president. Obama and Netanyahu offered a "good cop-bad cop" approach to Iran's nuclear ambitions.
Both countries have accused Iran of secretly working toward building a nuclear weapon, and Netanyahu it made clear Wednesday after his talks with Obama that he believes the president is equally committed to preventing a nuclear-armed Iran.
Obama called for more diplomacy while endorsing Israel's right to defend itself as it sees fit. He also insisted that "all options" remain open -- code for a military strike to disable the Iranian program.
Obama sought to assure Netanyahu and Israelis of his commitment to their security and to strengthen what have been strained personal and working relationships with the prime minister. Both of them are beginning new terms in office.
In what Netanyahu called a key development, the leaders announced new talks on extending U.S. military assistance to Israel for another 10 years past the current agreement that expires in 2017.
CNN's Jason Hanna, Tom Cohen, Holly Yan and Paul Steinhauser contributed to this report.