The Israeli military targeted the Al-Shuhada school in Nuseirat camp, killing 17 people and wounding dozens more, Mahmud Bassal, a spokesman for the agency, told AFP.
The toll was confirmed by Al-Awda hospital, which said the school had been hit by an air strike.
"Thousands of displaced people were sheltering in the school, most of them children and women," a statement issued by the Hamas government media office said.
The Israeli military said it had targeted Hamas militants when it struck the school.
The Israeli air force "conducted a strike on Hamas terrorists who were operating inside a command and control centre in the area of Nuseirat, which was located inside the school, the military said in a statement.
"The command and control centre... was used by the terrorists to plan and execute terrorist attacks against IDF (Israeli army) troops and the State of Israel," it said.
In recent months, Israeli forces have struck several schools-turned-shelters across Gaza, insisting that it was targeting Hamas militants.