A spokesman for the UN refugee agency (UNRWA) in Gaza City said the pupil had been wounded inside the school run by the international organisation.
"She was inside the classroom, sitting at her desk," Paul McCann said.
"We have repeatedly called on the Israeli army to control the fire of their soldiers in the vicinity of schools," he said.
"It is the fourth incident in under two years. Just last month, a 10-year-old girl died after being shot at her desk."
The incident threatened to escalate tensions between Israel and the United Nations Relief and Works Agency, which runs the school.
Soldiers fire indiscriminately
UNRWA, the main UN agency for Palestinian refugees, has accused Israeli occupation troops of firing indiscriminately in crowded areas.
Israel, however, makes counter accusations by saying resistance fighters use populated areas for cover thus endangering the lives of civilians.
Last month a 10 year old was
also shot in a classroom
In Tuesday's incident, UNRWA said Israeli troops had fired two shots from the nearby Jewish settlement Gush Katif.
It said one of the shots hit Ghadir Mukhaimar, a fifth-grade pupil at a UN elementary school in Khan Yunus.
Palestinian hospital officials said the girl was in a critical but stable condition after emergency surgery.
Fourth school attack
Israeli-UN relations have been strained for years, with Israel repeatedly accusing the world body of bias.
A UN team is in Israel to investigate Israeli allegations that a UN Palestinian driver loaded what appeared to be a rocket into a UN ambulance during a recent Israeli incursion in northern Gaza.
The UN says it is the fourth
Israeli attack on its schools
Even though Israel has backed away from its claim officials have said they want the UN team to determine whether it employs people who "aid and abet" Palestinian resistance fighters.
More than 110 Palestinians, mostly civilians and many of them children, have been killed so far in what the Israeli army calls Days of Penitence, the Gaza raid that was launched on 28 September.