After months of deadlock, Israel and Hamas appear to be moving closer toward a ceasefire to end their 14-month war.

Top officials from the U.S., Qatar and Egypt have resumed their mediation efforts in recent weeks and reported greater willingness by the warring sides to wrap up a deal. In a key concession, Hamas officials say they are prepared to show more “flexibility" on the timing of an Israeli troop withdrawal , and , said Monday that a deal is closer than ever.

Officials on all sides have cautioned that must still be worked out. But there is a general sense of optimism that has been lacking for many months.

The changing sentiment appears to be the result of several factors. Israel has inflicted heavy damage on Hamas over the course of the war. The group is more isolated after , and Iran, a key backer of both militant groups, has suffered a number of setbacks, highlighted by the , Syria’s .

In the U.S., both and the have signaled they want a deal completed before the Jan. 20 inauguration.

According to Egyptian and Hamas officials, the agreement would take place in phases and include a halt in fighting, an exchange of captive for , and a to the besieged Gaza Strip. Israel says Hamas — over one-third of whom are believed to be dead.

Here is a closer look at the emerging deal, according to the officials, who spoke on condition of anonymity because they were discussing closed negotiations.

Preliminary ceasefire

The first phase would last from six to eight weeks. During that time, Hamas would release some 30 hostages – roughly half of those believed alive. They include three or four .

Israel would release hundreds of Palestinian prisoners, including as many as 100 who are serving long sentences for alleged involvement in bloody attacks.

Increased aid

The deal calls for a massive increase in , which has plunged into a humanitarian crisis during the 14-month war. An estimated 90% of Gaza's 2.3 million people , in multiple times, and aid workers report across .

This is expected to include a reopening of the territory’s , which has been closed since the southern border town in May. The crossing is especially important because it is the primary exit point for Palestinians in Gaza who want to travel abroad, and the only one not controlled by Israel.

Mediators say they are considering a return to a 2005 agreement that allowed the internationally recognized Palestinian Authority to operate the crossing with European Union observers. That agreement collapsed when Hamas seized control of Gaza in 2007 and expelled the Palestinian Authority forces.

Israeli troop withdrawals

During the first phase, Israeli troops would withdraw from some Palestinian population centers, allowing many Palestinians to begin returning home. But Israeli troops wouldn't leave Gaza altogether at this stage. They would remain along – a strategic strip of land along Gaza’s border with Egypt.

Ending the war

During the initial ceasefire, the sides would continue negotiations on a permanent agreement, to include an end to the war, full withdrawal of Israeli troops, and release of remaining hostages and bodies held by Hamas.

Talks would begin on final arrangements for Gaza, including who would govern the territory and plans for rebuilding .

The ºÃÉ«tv Press. All rights reserved.