Interior Minister Nasser Youssef reached the deal with fighters who had bombarded settlements this week, the official said.
A recent flare-up of violence has threatened a three-month ceasefire.
"Factions, including Hamas, have agreed to stop rocket attacks" after Youssef asked them in talks held since Friday to help preserve the ceasefire, the official told Reuters.
Speaking to Aljazeera, Palestinian Interior Ministry spokesman Tawfiq Abu Khusa said that during the meeting all Palestinian factions showed their commitment to a period of calm and non-escalation against Israel.
Hamas unleashed intensive mortar strikes on Jewish settlements on Wednesday after Israeli soldiers killed a fighter and then shot another as he fired mortars at the Gush Katif settlement bloc, injuring one Israeli.
Youssef began talks to rescue the truce on Friday after Israeli forces killed a third Palestinian man, who fired light arms and anti-tank rockets at the Kfar Darom settlement.
"We can never stand silent in front of the Israeli crimes ... this (the commitment to non-escalation) does not mean we will stay silent while seeing Palestinian blood being shed in front of us"
Israeli Defence Minister Shaul Mofaz had threatened to use "all necessary means" to halt the attacks on settlements, which Israel is to remove under a planned Gaza pullout this August.
However, a Hamas spokesman, Mushir al-Masri, told Aljazeera that the commitment to non-escalation "does not mean we will give up our right to defend ourselves by all possible means".
"We will continue defending ourselves as long as there is a Zionist escalation. Up until this minute, the Zionist enemy has not been committed to the implementation of conditions and demands ... during the period of calm that Hamas and other Palestinian factions have been committed to," he said.
"Therefore, we can never stand silent in front of the Israeli crimes ... this (the commitment to non-escalation) does not mean we will stay silent while seeing Palestinian blood being shed in front of us."
Al-Masri said the recent tension had been triggered by the "dangerous escalation caused by Israeli raids and killings of people".
"The Israeli enemy has returned to its assassinations policy, killing more than 30 Palestinians and arresting dozens following [the recent] Sharm al-Shaikh summit," al-Masri said.
Meanwhile, Aljazeera's correspondent in Palestine has said that 13 detainees in a Palestinian Authority prison in Jericho are continuing a hunger strike, which they started on Friday, to demand their immediate release.
The detainees belong to the al-Aqsa Martyrs Brigades and the Islamic Jihad Movement. They include five Islamic Jihad members who were arrested in the wake of a bombing in Tel Aviv last February.