Sources close to the talks told Reuters earlier on Thursday that progress was made but it is uncertain if the agreement will hold, as an Israeli official had said the proposed terms were not satisfactory.
"This agreement is a critical step towards Gaza finally being governed by a new Palestinian government that will work closely with the Board of Peace to help the Palestinian people," Trump said in a social media post.
"At the same time, Israel will have the security it deserves, with Gaza no longer used as a base for terror attacks."
The Israeli embassy in Washington and Hamas did not immediately respond to requests for comment about Trump's post.
Earlier, Israeli strikes killed at least six Palestinians in Gaza on Thursday, including two children, medics said.
A Hamas official and a diplomat close to the Cairo talks said the progress would be tested by Israel's response and whether this allowed a broad accord to be reached.
However, the Israeli official earlier on Thursday, who declined to be identified, said Israel had rejected a proposal.
Hamas leaders are holding talks with mediators from Egypt, Qatar and Turkey on the second phase of President Donald Trump's Gaza plan, as presented to them by his Board of Peace, which oversees its implementation.
Russian Deputy Ambassador to the United Nations Anna Evstigneeva told the Security Council on Tuesday that a roadmap prepared by Trump's Board of Peace envoy for Gaza, Nickolay Mladenov, had so far failed to gain the support of Israel and Hamas, with the demilitarisation of Gaza remaining the main stumbling block.
The Board of Peace declined comment on the Cairo talks earlier on Thursday.
The diplomat close to the talks said the negotiations were making progress toward a roadmap that would see all heavy and light weapons in Gaza decommissioned.
The plan calls for a surge in humanitarian aid, governance by a civilian Palestinian administration, the disarmament of Hamas, the withdrawal of Israeli forces from Gaza and the deployment of an international force to help maintain security.
But progress has stalled in previous months.
On Thursday, a Hamas official said the group was coming with a "positive and good" response, but did not say whether the group had agreed to fully disarm — a key sticking point in the talks over the past four months.
Hamas wants Israel to commit to ending attacks on Gaza and withdrawing its forces.
Sources close to Hamas said the group was willing to "confine and store" heavy weapons under a Palestinian body, not hand them over to Israel. Hamas did not comment on the matter.
It is not yet clear what will happen regarding light or personal weapons or whether the new Hamas stance will be accepted by Israel or the Board of Peace.
The plan includes the elimination of tunnels, arms stockpiles and weapons production facilities, the diplomat said, adding that by the end of the process there would be no remaining militant infrastructure in Gaza.
The diplomat described the roadmap as being based on reciprocal steps rather than trust.
So far, the reality on the ground in Gaza remains far from this roadmap. The Israeli military has continued to expand its military occupation of Gaza, with Prime Minister Benjamin Netanyahu saying that Israel intends to expand the area under its control to 70 per cent of the enclave.
In Cairo, two Egyptian sources said Hamas had agreed to several contentious points, including the handover of weapons, but had requested changes regarding the definition of the infrastructure to be dismantled, adding more talks were under way.
The truce halted full-scale fighting but has not ended near-daily Israeli strikes.
More than 1200 Palestinians, mostly civilians, have been killed by Israeli attacks since the ceasefire took effect, according to Gaza health officials.
Four Israeli soldiers have been killed by militants in Gaza since the ceasefire.
Hamas does not usually disclose its losses.