In a crowded classroom in Gaza City, hands shoot in the air when teacher Moussa Ziara asks for a volunteer to come to the blackboard. The chosen boy carefully chalks a letter of the alphabet amid enthusiastic applause from his classmates.

It is not, perhaps, an atypical scene in a place where education is highly valued. What is unusual, however, is that these Palestinian boys are studying Hebrew; part of a resurgence in learning the "language of the enemy", fostered – remarkably – by Gaza's Hamas government.

Around 750 ninth-grade pupils in Hamas-run schools have begun studying Hebrew in a pilot scheme that could be extended in the coming years. It is the first time for almost two decades that the language of Israel is on the school curriculum.

And at the Islamic University in Gaza City, an institution with close ties to Hamas, 19 students have enrolled in a one-year postgraduate diploma in Hebrew that will qualify them to teach in government schools.

Somayia al-Nakhala, director of curriculum at the ministry of education, explains why Hamas put Hebrew on the curriculum: "It is better to know what Israel is thinking and saying than to know nothing. We have to know the language of our enemy – or our neighbour."

She points out that people in Gaza consume Israeli products, are prescribed Israeli drugs and often watch Israeli television via satellite or access Israeli websites. "We are connected to Israel," she said. "Politics is different from practicalities."

Until 20 years ago, thousands of Gazans worked as labourers or factory workers in Israel, picking up Hebrew as part of their daily existence. Palestinian doctors worked in Israeli hospitals; Gazan businessmen liaised with their Israeli counterparts on import and export deals; some learned the language during spells in Israeli prisons.

But, as Gaza was increasingly closed off from Israel, after the establishment of limited self-rule by the Palestinian Authority in 1994, the suicide bombings of the second intifada and the rise of Hamas as Gaza's ruling Islamist faction, the number of Hebrew-speaking Palestinians dwindled. Hamas is now taking steps to reverse the trend.

And there is no shortage of takers. At Shefie elementary school for boys, 350 out of 400 ninth-grade pupils wanted to sign up for Hebrew last September. Most were disappointed; due to limited teaching capacity, the school could offer only one class of 40 pupils.

"The children are very eager to learn, maybe because it's close to Arabic and easy to learn," said Ziara, their teacher. The class notched up a pass rate of 100% at the end of the first term.

In general, Gaza has high standards of education despite the fact that its overcrowded schools are forced to run large classes and a shortened day to accommodate two shifts in one premises. More than 92% of its population are literate, a higher rate than countries with comparable economies.

Ziara used to work in Israel as a trader, but has been barred from entry since 1999. "I'm not a politician, but we are neighbours with Israel whether we are at war or peace. So we need to learn their language.

"And the language is full of literature and culture, so it's enriching to learn," he said, stressing that this is a personal viewpoint.

One of the boys in his class, 14-year-old Naji Ayyad, says his family encouraged him to take up Hebrew, which his father speaks from his time as a worker in Israel. "It's good to understand the enemy language in order to counter them," he said.

Indeed, language has become a weapon in the propaganda war between the two sides. The military wing of Hamas, which does not recognise Israel's right to exist, tweeted in Hebrew during the eight-day conflict in November. The Israeli authorities regularly send text messages in Arabic to Gazans, and shower the territory with warning leaflets written in Arabic.

At the Islamic University, teacher Jamal al-Hadad, who gained a diploma in Hebrew literature from Israel's Ben-Gurion University in 1978, says the language is easy for Arabic speakers to learn. "Arabic and Hebrew are very close, the languages have the same roots." He uses as a teaching tool a stapled booklet of his own poems – on "peace, beauty, love, politics and friendship" – which he has translated into Hebrew.

There have been a few objections to Hebrew being taught in Gaza, he says, but "many people want to learn the language precisely because we are in a conflict with Israel. They want to know the impact of that conflict, they want to be able to follow the news in Israel."