Washington (CNN) -- President Barack Obama spoke by telephone Tuesday with Turkish Prime Minister Recep Tayyip Erdogan to express condolences for the deaths and injuries from Israel's raid on a Turkish ship that was part of a flotilla hauling relief supplies to blockaded Gaza, the White House said.

"The president told Prime Minister Erdogan that the United States is working in close consultation with Israel to help achieve the release of the passengers, including those deceased and wounded, and the ships themselves," according to the White House statement. "He also affirmed the United States position in support of a credible, impartial and transparent investigation of the facts surrounding this tragedy."

A statement posted on the website of the Turkish prime minister's press office said that in the hour-long conversation, Erdogan called the Israeli attack "an unacceptable act that was illegal and against international practices."

"Israel is about to face the danger of losing its only friend in the region that made the highest contribution to peace in the region," Erdogan said in the conversation, according to the website posting. "The steps that it will take in the coming days will determine its position in the region."

The White House said Obama cited the importance of finding better ways to provide humanitarian assistance to the people of Gaza without undermining Israel's security. The president emphasized the continuing U.S. commitment to working with Israel, Turkey and others "with a stake in a more stable and secure Middle East."

Israel began releasing activists detained from the Gaza flotilla Tuesday as humanitarian cargo aboard the ships was unloaded and taken into the blockaded Palestinian territory. At least nine people aboard the ships died in the Israeli raid, which also left seven Israeli soldiers injured.