United States President Barack Obama spoke to Israeli Prime Minister Benjamin Netanyahu and Egyptian President Mohamed Morsi Wednesday, hours after Morsi took diplomatic steps against Israel's offensive in Gaza.

Obama spoke to the leaders about the rocket attacks being launched from Gaza into Israel and the escalating violence in Gaza, reiterating U.S. support for Israel in light of rocket attacks from Gaza, the White House said in a statement.

"The President urged Prime Minister Netanyahu to make every effort to avoid civilian casualties. The two agreed that Hamas needs to stop its attacks on Israel to allow the situation to de-escalate," the statement said.

"The President also spoke with President Morsi given Egypt's central role in preserving regional security. In their conversation, President Obama condemned the rocket fire from Gaza into Israel and reiterated Israel's right to self-defense," it said.

Earlier in the day, Morsi recalled Egypt's ambassador from Israel due to the Israeli offensive, which killed Hamas military chief Ahmed Jabari in an airstrike and targeted weapons warehouses and long-range rocket launchers during the day.

In the offensive, called Operation Pillar of Defense, the Israel Defense Forces hit more than 20 targets in the Gaza Strip, including rocket warehouses and rocket-launching facilities. Palestinians say eight people in the Gaza Strip were killed, including Jabari, and more than 30 were injured.

"President Mohamed Morsi has followed the Israeli brutal assault in which a number of martyrs and sons of the Palestinian people were killed," presidential spokesman Yasser Ali said in a statement aired on television.

"On this basis he has recalled the Egyptian ambassador from Israel; has ordered the Egyptian representative at the United Nations to call for an emergency meeting at the Security Council...and summoned the Israeli ambassador in Egypt in protest over the assault," the statement added.

"On behalf of the Egyptian people the president gives his condolences to the Palestinian people over their martyrs," Ali said.

The IDF attack has caused a diplomatic crisis between Israel and Egypt. Morsi called an emergency session of Egypt's National Security Council and announced four steps Egypt will take in protest of Israel's attack on Gaza. The most serious step is the recalling of the Egyptian envoy in Tel Aviv. Egypt will also summon the Israeli envoy in Cairo to reprimand him over the attack, call for an emergency meeting of the Arab League and work to convene a special seating of the UN Security Council. Egypt has also urged Israel, via indirect messages, to halt the Gaza assault.

In parallel, Egyptian intelligence has been working to mediate a cease-fire agreement between Gaza and Israel. Two hours following the start of the IDF attack, Egyptian intelligence officers – partly due to Hamas requests – urged Israel's Defense Ministry to halt the operation. Israeli officials responded by saying that the operation will end only when its goals are achieved and the rocket fire ends.

Reuters contributed to this report