President Barack Obama spoke on the unrest in the Middle East while on a trip to Asia. The president's trip is meant to put a focus on foreign policy, with the president making a tour of the region, including Myanmar and Cambodia. NBC's Chuck Todd reports from Bangkok.

President Barack Obama said Sunday that Israel has “every right” to defend itself against missile attacks by militants inside Gaza but warned that escalating the offensive with Israeli ground troops could undermine any hope of a peace process with the Palestinians.

"Let's understand what the precipitating event here that's causing the current crisis and that was an ever-escalating number of missiles that were landing not just in Israeli territory but in areas that are populated, and there's no country on Earth that would tolerate missiles raining down on its citizens from outside its borders,” Obama said at press conference in Thailand at the start of a three-nation tour in Asia.

“So we are fully supportive of Israel's right to defend itself from missiles landing on people's homes and workplaces and potentially killing civilians."

He added: "Israel has every right to expect that it does not have missiles fired into its territory. If that can be accomplished without a ramping up of military activity in Gaza, that's preferable. It's not just preferable for the people of Gaza. It's also preferable for Israelis, because if Israeli troops are in Gaza, they're much more at risk of incurring fatalities or being wounded."

Netanyahu: Israel prepared for ‘significant expansion’ of Gaza operation

More than 50 Palestinians have been killed and hundreds more wounded in the four days of Israeli assaults. Egyptian officials are working on securing a truce between Israel and the Palestinian factions, which could help avert a war both sides say they are prepared to fight. NBC's Ayman Mohyeldin reports.

Obama directed some of his comments to the heads of state of Egypt and Turkey, both countries that are supportive of the Palestinians. “Those who champion the cause of Palestinians should recognize that if we see a further escalation of the situation in Gaza than the likelihood of us getting back on any kind of peace track that leads to a two-state solution is going to be pushed off way into the future,” he said.

Obama's comments came as Israel's campaign against Hamas militants in Gaza blasted into its fifth day. Israel is at a crossroads of whether to launch a ground invasion or pursue Egyptian-led truce efforts, and Obama sought to clearly defend the U.S. ally's military rights while pushing for a halt in the violence.

Key players in the Israel-Gaza cross-border conflict

Israeli Prime Minister Benjamin Netanyahu declared Sunday that Israel was prepared to significantly expand its military operation in Gaza. Obama has been lobbying Netanyahu along with the leaders of Egypt and Turkey to try to halt the crisis -- including stopping rocket strikes on Israel.

He said Israel was justly responding to "an ever escalating number of missiles that were landing not just in Israeli territory, but in areas that are populated. And there's no country on earth that would tolerate missiles raining down on its citizens from outside its borders."

Obama said Palestinians will have no chance to pursue their own state and a lasting peace with Israel as long as rockets are fired into Israel. He said he hoped for a clearer process over the next 48 hours -- showing how much the Mideast conflict had intruded on his diplomatic mission to Asia.

NBC News' Shawna Thomas and The Associated Press contributed to this story.

More content from NBCNews.com:

Follow US news from NBCNews.com on Twitter and Facebook