Israel shot artillery shells into a U.N-run school housing Gaza evacuees early Wednesday, killing at least 20 and wounding many others, according to Palestinian officials and the school's U.N. agency.

According to officials, the shelling occurred while the evacuees were sleeping.

The Israeli military then announced that it would implement a temporary cease-fire in Gaza for humanitarian reasons between 3 and 7 p.m. Wednesday. They said the cease-fire will not apply to areas where the Israeli military is operating.

Hamas dismissed the cease-fire as a "media stunt," according to The Washington Post.

The statement added that "the IDF will respond to any attempt to exploit this window to harm Israeli citizens and Israeli soldiers."

The most recent cease-fire occurred on July 27, but the 24-hour cease fire was cut short when Hamas violated it by shooting rockets into Israel.

According to the U.N. Relief and Works Agency (UNRWA), which operates the shelter in the Jabaliya refugee camp, said the facility was shelled by Israeli forces, and the IDF is investigating the attack.

UNRWA called the attack "a source of universal shame."

"We have analyzed fragments, examined craters and other damage," the agency released in a statement. "Our initial assessment is that it was Israeli artillery that hit our school, in which 3,300 people had sought refuge."

Israel said that some of the organization's schools are being used by Hamas to store rockets that are then lobbed into Israeli territory. The U.N. did not comment on this statement, but said it has found rockets hidden in schools and other civilian facilities in Gaza.

UNRWA said rockets were discovered at a different Gaza school Tuesday, the third discovery since the fighting began three weeks ago. The agency condemned the militant groups for putting civilians at risk.

Capt. Eytan Buchman, a spokesman for the Israeli army, said IDF troops were bombarded with militant fire Wednesday near the school and responded with force.

According to Gaza Health Ministry officials, 40 people were killed in Israeli air strikes overnight, and more than 110 were injured. The Palestinian death toll is now more than 1,270, and Israel has lost 53 soldiers, two Israeli civilians and a Thai worker.

The strike on the school followed one of the heaviest days of fighting, in which Israel disabled Gaza's electricity plant, leaving Gaza residents without water or electricity. In addition to being Gaza's source of electricity, it also powered water pumps, sewage systems and hospitals.

On Monday, Israeli Prime Minister Benjamin Netanyahu said in a televised address that Israel will not stop the campaign until it dismantles the network of tunnels that Hamas militants are using to infiltrate Israel.

On Tuesday, Israel gained ground by destroying the home of Ismail Haniyeh, a top Hamas official. Haniyeh is currently in hiding, and his location is not known. No one was killed or injured in the attack.

Haniyeh made a statement to journalists that the attack will not stop Hamas from continuing its assault on Israel.

The IDF called a neighbor in the area to tell residents to evacuate. The IDF calls residents prior to strikes, in addition to dropping leaflets and shooting small warning rockets onto roofs to warn residents to evacuate.

Israel also hit the al-Asqa television broadcast center, which is run by Hamas, in addition to a financial building and the homes of mayors.

In addition, Israel hit a fishing harbor near hotels housing international journalists, as well as the Rafah area.

The IDF said Tuesday that its forces were attacked by Hamas militants trying to infiltrate Israel through a tunnel. A standoff ensued. The IDF said a similar incident occurred on Monday, in which five soldiers were killed in a battle with militants. One militant was killed in the fighting.

Early on Tuesday, Hamas continued to shoot rockets into southern Israel, forcing Israelis to take shelter in Tel Aviv, the nation's capital.

Israel responded by striking the al-Amin Mohammed Mosque, near the home of Mahmoud Abbas, the president of the Palestinian Authority. Civilians insisted that the mosque was not Hamas-run.

"This is a mosque for the public, and I am one of the public," said Muhammed Abdu, a 45-year-old engineer, according to The Washington Post.

However, he said he does not believe Hamas should stop attacking Israel until Israel and Egypt lift Gaza's economic blockade.