Haniyeh's visit came in response to a special invitation from Cairo, in advance of a broader meeting of Palestinian factions that could begin as early as next week, Hamas spokesman Hazem Qassem told Reuters.
Egypt has played a major role in the brokering of a ceasefire between Israel and Hamas, the Islamist group which rules Gaza, after 11 days of conflict erupted on May 10.
More than 250 Palestinians were killed in hundreds of Israeli air strikes on Gaza during that conflict. Rockets fired by Gaza militants killed 13 people in Israel.
Haniyeh and Egyptian officials will discuss cementing the truce with Israel as well as reconstruction plans for Gaza, Qassem said. Egypt has said it will allocate $500 million for the reconstruction.
Egyptian authorities hope to meet members of Hamas' rival Fatah, including Palestinian President Mahmoud Abbas, the Egyptian sources said. Fatah controls the West Bank.
Egypt has tried in the past to foster cooperation between Palestinian factions that is seen as crucial to any wider efforts to promote peace in the region.A delegation from Fatah led by Jibril Rajoub is expected in Cairo in the coming days, a Palestinian official said.