Hamas has a network of tunnels, two of which have just been discovered under schools, that have been used in the past as firing positions, shelter from Israeli attack, storage for weapons and at times to enter Israel and capture soldiers.

The UN agency for Palestinian refugees on Friday said it has protested to the Islamist movement Hamas after finding a tunnel under two of its schools in the Gaza Strip.

Over the years, Gaza's Hamas rulers have built a labyrinth of tunnels, including ones that cross under the border with Israel, and have used them to launch attacks during the 2014 Gaza war.

On June 1, UNRWA found "part of a tunnel that passes under two adjacent agency schools in the Maghazi camp" of Gaza during construction work, spokesman Christopher Gunness said.

He said in a statement that the tunnel "has no entry or exit points on the premises nor is it connected to the schools or other buildings in any way".

"UNRWA condemns the existence of such tunnels in the strongest possible terms. It is unacceptable that students and staff are placed at risk in such a way."

"The construction and presence of tunnels under UN premises are incompatible with the respect of privileges and immunities owed to the United Nations under applicable international law, which provides that UN premises shall be inviolable," he said.

Gunness said that the Palestinian refugee agency "has robustly intervened and protested to Hamas in Gaza".

UNRWA, he said, will seal the tunnel which was discovered during the summer holiday at a time when the schools were empty.

Attack tunnels were a key weapon for Hamas during the 2014 Gaza war.

Hamas also built a vast network of tunnels under Gaza's border with Egypt to smuggle goods and allegedly weapons.

Israel's army found and destroyed several tunnels during the 2014 war.