Palestinian factions -- Hamas and Fatah agreed to a cease-fire late Monday in a bid to end four days of violence that killed at least 29 people in Gaza and the West Bank, CNN reported. The cease-fire, announced by Palestinian Foreign Minister Mahmoud Zahar, began 3 a.m. Tuesday (7 p.m. Monday ET). In the hours before the deadline, gunfire and explosions could still be heard in Gaza City. The agreement calls for both sides to withdraw their armed men from the street, except for Palestinian police, and stop all clashes, as well as refrain from making inflammatory comments. Since in-fighting erupted late last week, more than 50 members of Fatah and Hamas have been kidnapped, Palestinian security sources said. Hamas and Fatah leaders have agreed to exchange kidnapped prisoners and participate in a face-to-face meeting, Zahar told reporters. Hamas has controlled the Palestinian parliament since last year, when elections ended decades of Fatah control. However, the Palestinian Authority presidency is held by Fatah leader Mahmoud Abbas. Talks aimed at forming a power-sharing government were suspended after the latest outbreak of violence, which began Thursday when a Hamas operative was killed by a bomb in the Jabalya refugee camp in Gaza.