Israelis show support and give gifts to soldiers in the city of Ashdod on Sunday on the fifth day of Israel's bombardment of the Palestinian Gaza Strip.
"Israel has every right to expect that it does not have missiles fired into its territory," Obama said, adding, "if that can be accomplished without a ramping up of military activity in Gaza, that is preferable".
"That is not just preferable for the people of Gaza, it is also preferable for Israelis because if Israeli troops are in Gaza, they are much more at risk of incurring fatalities or being wounded," he said.
Obama spoke, in Thailand, after Israeli Prime Minister Benjamin Netanyahu said Israel was ready to "significantly expand" its operation against militants in the Gaza Strip, sparking fears of a new invasion.
The US president said the "precipitating event" of the Gaza crisis was a string of extremist rocket attacks on Israeli territory, which he said no nation in the world would tolerate.
He also backed the Jewish state's right to self-defence on a day in which the crisis deepened, with two rockets shot down over Tel Aviv and the Palestinian death toll from retaliatory strikes reaching 56.
Obama, who visited Israeli border areas around the town of Sderot when he was a candidate for president in 2008, said it was clear what had caused the latest crisis over Gaza.
"Let's understand what the precipitating event here was… that was an ever-escalating number of missiles that were landing not just in Israeli territory but in areas that are populated."
"There is no country on earth that would tolerate missiles raining down on its citizens from outside its borders."
Obama has spoken to Netanyahu, with whom he has had a tense relationship, several times since the start of the crisis, most recently on Friday.
Netanyahu has expressed deep appreciation for US investment in the Iron Dome rocket and mortar defence system, which he said has stopped hundreds of incoming rockets from Gaza.
In the latest retaliatory strikes by Israel on Sunday, three people were killed, including two women, in Gaza City.
Netanyahu said Israel was ready to "significantly expand" its operation against militants in the Gaza Strip.
"We are extracting a heavy price from Hamas and the terror organisations," he said at the weekly cabinet meeting.
"The army is prepared to significantly expand the operation."
British Foreign Secretary William Hague warned on Sunday that Israel could lose much of its international support if it sent troops into Gaza.
"A ground invasion of Gaza would lose Israel a lot of the international support and sympathy that they have in this situation," he said. "It's much more difficult to restrict and avoid civilian casualties during a ground invasion and a large ground operation would threaten to prolong the conflict." – Sapa-AFP