Israel declared the territory a "hostile entity" and has blockaded it in an attempt to pressure Hamas into stopping rocket fire from the strip into Israel.
Over the past seven days, more than 20 people have died in Gaza as a result of Israeli military action. In the same period, the Israeli army says that Palestinian militants have fired more than 90 rockets and mortars into Israel.
Egypt, which has worked for months to clinch a deal between Israel and Hamas, urged both sides to "exert all efforts to bring the calm to a success", senior officials were quoted as saying.
The BBC's Tim Franks in Jerusalem says a ceasefire should lead to an improvement in people's everyday lives in southern Israel and Gaza, but any talk of political upheaval or breakthrough is premature.
Palestinian and Egyptian officials say the truce is to come into effect at 0600 (0300 GMT) on Thursday. As well as a halt to all hostilities, this stage of the deal also envisages a partial reopening of Gaza's borders, they add.
A second stage would focus on the return of captured Israeli soldier Gilad Shalit and on a deal to reopen the main Rafah crossing into Egypt, they say.
In the talks process until now, Israeli concerns have centred on whether all militant groups would adhere to a truce, and what Egypt would do to stop arms smuggling into Gaza, says our correspondent.
Israeli officials stress that phone lines to Cairo are "still running hot".
In a televised speech, Mr Barak said: "We are studying the possibility of rapidly reaching a period of calm.
If anybody does anything, they will be doing it on their own
Ahmed Yousef, Hamas official
"It is still too soon to talk of that period of calm and when it comes into force, supposing it does come into force, it is difficult to know how long it will last."
A Hamas leader in Gaza, Mahmoud Zahar, confirmed at a news conference that militant groups had agreed a truce.
Hamas official Ahmed Yousef told the BBC: "I am confident that everybody will abide by what we've agreed. All the groups which went to Cairo gave their okay to the ceasefire.
"If anybody does anything, they will be doing it on their own."
According to a detailed breakdown released by Hamas, Israel will ease its restrictions on Gaza crossings with Israel on Friday morning, followed by the bigger commercial crossings next week.
After two weeks, talks will start involving Israel, Hamas, the Palestinian Authority and the European Union on finding agreement on reopening the Rafah crossing into Egypt, Hamas says.
The truce will apply only in Gaza, Hamas says, and it will not be allowed to respond from Gaza to any Israeli action in the West Bank.
Egyptian officials say they will continue efforts to broker a similar ceasefire in the West Bank.
The last ceasefire between Hamas and Israel ended in April last year, shortly before the Islamist movement took control of the Gaza Strip.
Mr Yousef said that the aim now was to push ahead talks on a prisoner exchange, as well as a new round of talks in Cairo between the rival factions of Fatah and Hamas.
A delegation from Fatah has already travelled to the Gaza Strip from the West Bank for talks with other party members.
The group is the first representing Mr Abbas to go to Gaza since Hamas seized control. Hamas has said it is prepared to hold talks with the Fatah officials, but there has been no word from Fatah on whether such a meeting will take place.
The aftermath of Israeli air strikes in southern Gaza
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.