CAIRO (Reuters) - Egypt remains committed to helping negotiate a ceasefire and hostage release deal in Gaza despite doubts about its mediation role, and it is in touch with Israel about setting dates for new talks, two Egyptian security sources said on Thursday.

Egypt, Qatar and the United States have been attempting over months of stop-start talks to strike a phased agreement between Israel and Hamas that would lead to truce in Gaza and the gradual release of Israeli hostages held in the territory.

On Wednesday, Egypt indicated it might withdraw from its role as a mediator amid tensions related to the stalling of previous talks and Israel's military advance in the southern Gaza city of Rafah.

Egyptian mediators received calls from Israeli security officials on Wednesday and Thursday in which the Israelis thanked Egypt for its role, the Egyptian sources said.

During the calls, the Egyptians stated their desire to conclude the Gaza negotiations and agreed to set a date for talks.

After a late-night war cabinet meeting on Wednesday, Israeli Prime Minister Benjamin Netanyahu's office said in a statement: "The war cabinet has instructed the negotiation team to continue negotiations to return the hostages."

Israel's offensive in Rafah and its decision to take operational control of the Rafah crossing between Gaza and Egypt's Sinai Peninsula have angered Egypt, which is nervous about any mass displacement of Palestinians due to the war.

The U.S. has called on Egypt to facilitate a resumption of aid deliveries through the Rafah crossing but Egypt says it wants the Gaza side of the crossing to be restored to Palestinian control for aid flows to restart.

(Reporting by Ahmed Mohamed Hassan and Maayan Lubell; Writing by Aidan Lewis; Editing by Philippa Fletcher)