The United Nations on Wednesday denied Israel Defense Forces claims that there were Palestinian militants in the Gaza school bombed by Israel on Tuesday.

Christopher Gunness of the UN Relief and Works Agency (UNRWA) said the organization is 99.9 percent certain there were no militants or military activity in its school.

That does not necessarily contradict Israel's claim that the militants were operating close by, Gunness said.

Gunness put the death toll of the shelling at 40, and added that the agency wants an impartial investigation of witnesses, Israeli military photographs or any other evidence.

The IDF on Tuesday released video footage from 2007 showing Palestinian militants firing from the school compound and carrying a rocket launcher with them as they flee the scene.

Gunnes said the 2007 video bears no connection to Tuesday's military strike on the school.

The IDF bombed the UNRWA school, Fakhura, on Tuesday after militants fired mortars at troops from inside the school, according to the IDF Spokesman's Office. The bodies of militants were found inside, it added.

Three shells hit the girls elementary school, which is located near the Jabalya refugee camp, according to Gunness.

Fakhura, like many other UNRWA schools, was serving as a refuge for people who had been forced to flee their homes.

"The initial examination conducted with forces operating in the area shows that mortar shells were fired from within the school at IDF forces. The IDF returned fire," the IDF Spokesman's Office said, adding, "In the past Hamas has fired at Israeli troops from within the school, making cynical use of civilians."

The casualties included Hamas militants Imad and Hassan Abu Askhar, both of whom had fired mortar shells at troops from the school, the spokesman said.

UNRWA demanded an independent investigation and the indictment of anyone found to have violated international law.

Many of the victims have still not been identified.

This is the second UNRWA school the IDF has shelled in 24 hours.

About 15 hours before Fakhura was shelled, at about midnight on Monday, the IDF fired a missile at UNRWA's Asma school, in the Shati refugee camp north of Gaza City, killing three members of the Al-Sultan family - Hussein, 24, Abed, 19, and Rawhi, 25 - as they emerged from the toilets in the courtyard.

Gunness said that UNRWA gave the IDF the coordinates of all of the 23 schools that are serving as refuges for the 14,000 people forced to flee their homes. Each of the schools hit on Tuesday housed about 400 people.

Meanwhile, a top world Islamic body accused Israel on Wednesday of war crimes in its Gaza offensive and said it should face an international court after the school attack.

"This is a brutal crime and a clear war crime, along with other attacks, and its perpetrators must not escape an international trial," Ekmeleddin Ihsanoglu, secretary-general of the Organization of the Islamic Conference (OIC) said in a statement.

The 57-nation OIC, based in Jeddah, represents over one billion Muslims. The body, whose charter dates back to the early 1970s when Islamic nations were divided along the lines of the Cold War, has little political power.