GAZA CITY, Gaza Strip — Atayeb Odeh is crazy about dogs.

He got his first when he was one-year-old, his second aged three and third when he was five. He’s now 17 and proudly shows off Liza — a gangly and gregarious German shepherd.

"We noticed a great state of fear among the citizens when the dogs were being walked"

But the high school senior cannot take Liza and her pal Rex — a white-and-brown mutt — beyond the front gate of his family's compound.

Hamas — the militant group that runs the poor, Israeli-blockaded Gaza Strip — recently decreed dogs can’t be walked in markets, roads and along beaches.

That ruling angered dog owners in the Palestinian enclave, where daily life already included widespread power shortages, scant running water and crumbling services.

“I love dogs — and they like me too," Odeh told NBC News. “I like playing with dogs, having them around."

Atayeb Odeh with his dogs Liza and Rex. Dave Copeland / NBC News

Odeh's not alone — in recent years it has become increasingly fashionable to keep dogs in Gaza.

Hamas says the decision was intended to protect local people, “especially women and children, who are frightened and panicked by the dogs," police spokesman Ayman al-Batniji said. “We noticed a great state of fear among the citizens when the dogs were being walked with their owners in the streets and along the beaches."

University student Amal Hussein agrees the dog situation has gotten out of control.

“People in Gaza are afraid of dogs,” the 24-year-old said. “There was one time I saw a child screaming in panic and fear because she saw a young man walking a huge dog in the market."

And then there are the young men who use dogs to “harass and intimidate” girls and women, she added.

A map showing the location of Gaza. Google Maps

Another thing working against dogs and their owners is religion.

Al-Batniji, the police spokesman, said Hamas is trying to “prevent the widespread raising of dogs” — a reflection of the fact that many observant Muslims consider the animals unclean and believe they shouldn’t be kept as pets and indoors.

While working dogs are allowed under Islam, the Hamas ban has also hit those who raise the creatures to be guard dogs. Mouin al-Awad, a 28-year-old dog trainer, has been forced to keep his two German shepherds on the roof of a building, where temperatures often top 100 degrees Fahrenheit.

Mouin al-Awad, right, keeps his dogs on the roof of a friend's building. Dave Copeland / NBC News

“I put my dogs here because if I put them downstairs they will be killed or stolen,” he said. “I’m not allowed to take them anywhere. We lock our dogs here because there is no safety.”

The animals represent a big investment. It costs around around $425 to buy a Gaza-born German shepherd, and up to $4,000 to import one from outside the enclave.

While officials insist the measures are necessary for the good of the public, Odeh said the ban is emblematic of the increasingly stifling conditions he and his peers are forced to endure.

“I’m trying to live like a teenager, like a normal one, like other teenagers outside," the high school student said.

Wajjeh Abu Zarifa and Dave Copeland reported from Gaza City. Lawahez Jabari reported from Tel Aviv. F. Brinley Bruton reported from London.