FOUR years ago, when Muhammad Abu Khair took in his first dog, it caused a family feud. His daughter brought home a stray that was wandering the streets of Jabalia, a district of Gaza City. He was unhappy about keeping it, a common feeling in Gaza’s conservative society: Islam views dogs as unclean and frowns on owning them as pets. But he relented, hoping to make his daughter happy. His relatives were not so understanding. For a while they stopped visiting the house.

Today he struggles to keep the visitors away. A group of enthusiasts organised a dog show in a public park in February, the first of its kind in Gaza. The event was covered in local media, and the pictures set off a canine craze across the territory. A Facebook group called “German Shepherds of Gaza,” which posts photos and information about different breeds, has added more than 70,000 members.

Dozens of owners even hope to earn a living as breeders, though dogs are an impossible indulgence for many in Gaza, where nearly half the population of 1.8m is unemployed and 75,000 families are still internally displaced after a devastating 2014 war with Israel. A small puppy can fetch $500, a larger breed twice as much, if you can find one to buy.

The agriculture ministry has had no budget for animal vaccines for the past five years, so some pets are getting ill. Rabies is rare, but owners worry about parvovirus, a gastrointestinal bug that is often fatal to puppies. Hamas, the Islamist group that controls Gaza, does little to help; it won’t even issue licences or health certificates for dogs. Some imams try to remind the faithful about the religious prohibition.

Their edicts, though, are no match for the widely-shared photos of dogs frolicking on the beach. Reliably cheerful and blissfully unaware of history or politics, the dogs offer Gazans a rare escape from the grimness of their lives.

Mr Abu Khair now owns seven. Most live on the roof of his building, where he built wooden kennels with thatched roofs. He says they helped him through a long bout of depression after he lost his job as an engineer. His favourite, a golden retriever named Mickey, was born in Israel, only to slip across the heavily fortified border into Gaza. “All of us want to go in the other direction,” Mr Abu Khair jokes. As for Mickey, “he gives us a lot of positive feelings. That’s hard to find in Gaza today.”