The groups on Thursday said, however, Israel must meet Palestinian demands that it free prisoners and withdraw from West Bank towns.
Sharon said the Palestinian armed groups must disarm.
The Palestinian factions' agreement, reached in Egypt after 48 hours of talks, strengthens Palestinian President Mahmud Abbas' hand as he tries to revive talks with Israel on an independent Palestinian state, analysts said.
If the truce holds, Israel could more easily carry out its plan to pull its troops out of Gaza, but it could also come under more international pressure to make other gestures.
'Positive first step'
Sharon's office said in a statement the prime minister told Egyptian President Husni Mubarak by telephone: "The arrangement reached in Cairo is a positive first step."
A joint statement by the 13 groups said maintaining the current period of calm, agreed upon by Abbas and Sharon at a summit in Egypt on 8 February, was part of their programme for 2005.
It did not set a specific time limit for the truce but the leader of Hamas said it could expire before the end of the year if Israel did not make reciprocal gestures.
Sharon wants Palestinian armed
factions to be disarmed totally
"The calm will be until the end of 2005 and even during the year our commitment to the calm ... is linked to the enemy's commitment to the conditions required and Palestinian demands," Khalid Mishal of Hamas said.
Hamas and the leadership of the second resistance faction, Islamic Jihad, have gone along with the informal ceasefire since February but had declined to endorse it formally.
In the talks this week, they held out for a detailed timetable for steps the Israelis should take, but eventually went along with the mainstream Fatah movement on vaguer wording.
The final statement from the talks said: "The attendees agreed to a programme for the year 2005 based on commitment to maintain the current climate of calm in exchange for an Israeli commitment to stop all forms of aggression against our land and the Palestinian people, wherever they might be, and the release of all prisoners and detainees."
The reference to 2005 was added at the last minute as a concession to the armed factions, delegates said.
PA wants Israel to take steps to
make life easier for Palestinians
Abbas needs the truce to hold so he can persuade Israel to take steps to make life easier for ordinary Palestinians, such as removing checkpoints and improving economic conditions.
Other Palestinian demands include an end to Israeli settlement activity in occupied territory and to work on the barrier Israel is building through the West Bank.
Sharon noted the deal was an interim agreement and said progress in the peace process hinged on disarming the fighters, a step Abbas has been reluctant to take for fear of conflict.
"The terrorist organisations cannot continue to exist as armed groups and certainly not as terrorist organisations," Sharon was quoted as saying, referring to the resistance factions.
Window of opportunity
Abbas has tried to draw them into political action and away from violent activities. Palestinians say the Israeli demands are designed to provoke civil war between Palestinians.
Egyptian analyst Abd al-Munim Said, director of the al-Ahram Centre in Cairo, said the ceasefire agreement opened a window of opportunity which could last months, but not years.
"Any dismantling of Islamic Jihad or Hamas will mean a civil war"
Abd al-Munim Said,
Al-Ahram Centre, Cairo
"(The truce) will promote the peace process, but this will depend on the Israelis. Any dismantling of Islamic Jihad or Hamas will mean a civil war," he said.
Foreign Minister Ahmad Abu al-Ghait of Egypt, which sponsored the talks, said: "We need a number of months and perhaps until the end of the current year to reach the situation as it was on 28 September 2000."
He was referring to the start of a Palestinian uprising against Israeli occupation. More than 4000 people, mostly Palestinians, have been killed since then.
In deference to the views of resistance leaders, the final statement said the Palestinian people had the right to resist the Israeli occupation. Abbas himself favours non-violence.
It also offered fighters the prospect of integration into a reactivated Palestine Liberation Organisation (PLO), which for the past 40 years has been the monopoly of secular, leftist and nationalist groups.
Abbas aide Jibrail Rajuub said it was now the turn of the international community to lean on Israel.
"We have declared today a total ceasefire and now we are asking the international community to put pressure on Israel so they will abide by their commitments," he said.