When one thinks of Muslims, "animal lovers" is probably not the first thing that comes to mind - let alone "dog lovers".
A quick Google Image search for "Dogs in Islam" is enough to reveal that the general perception when it comes to dogs and Muslims is that the two should not coexist.
Images of murdered dogs are among the first to show up in the search, along with an image that reads "Kill dogs. They are unclean and against Islam (Islamic) morals."
But, does Islam really frown upon canines?
In his book The Animal in Ottoman Egypt and an article published on Quartz, professor of history at Yale University, Alan Mikhail, sets the facts straight about dogs in Islamic culture.
Mikhail pinpoints the historic events that led to the negative perception of dogs in Muslim communities.
"A long history of positive interactions between Muslims and dogs that goes back to the religion’s very beginnings"
While Muslims traditionally think of dogs as impure, Mikhail argues that there is a "long history of positive interactions between Muslims and dogs that goes back to the religion’s very beginnings."
Mikhail writes that the world's first Muslims - the prophet's cousins and companions - regularly interacted with dogs and even raised their own puppies.
Canines actually played a major role in helping tame and protect the herds of sheep and goats from which Muslims made a living. They also helped protect property and accompanied Muslims during hunting expeditions.
Authorities relied on dogs in urban planning
Canines played a major role in urban planning, as authorities in Muslim cities relied on them to consume waste and keep the streets clean.
"Muslim leaders built watering troughs for dogs, many mosques threw out food for them," writes Mikhail, adding that people who abused dogs faced penalty.
Prophet Muhammad prayed in the presence of dogs
While some sayings attributed to the prophet accuse him of being hostile towards canines, many Islamic scholars claim that they are fabricated.
According to Mikhail, dogs were found around the Mosque of the Prophet in Medina, the second holiest Islamic site in the world, during the prophet’s life and for centuries after his passing.
Citing "several authoritative accounts of his life and teachings", Mikhail writes that the prophet even conducted prayer in the presence of dogs.
Additionally, according to some Islamic schools of thought, the prophet is believed to have forbade people from selling and paying for dogs and cats.
When did this change?
In the late 1800s, Middle Eastern communities witnessed a change in attitude towards canines and people began deeming the latter as "useless" and "hazardous to public health."
This came after people noticed an association between garbage sites and diseases like cholera and malaria.
Subsequently, authorities started collecting trash and moving it outside cities, which drove away dogs that consumed this trash.
"The historic connections between dogs and trash did not serve the animal well. Not only was there simply less garbage to eat in cities, but the garbage that did remain was now seen as a threat to public hygiene and soon too were its canine consumers," Mikhail states.
At the time, people considered that canines lacked purpose and raised health concerns, leading to extensive dog eradication campaigns.
Present-day Muslim attitudes towards dogs
According to the most common schools of thought, and contrary to popular belief, dogs are not haram in and of themselves.
These schools consider that touching dogs is permissible so long as one does not come into contact with their saliva. In that case, the person should simply purify oneself with soil or water before performing Islamic prayer.
Still, keeping dogs is not encouraged, and some scholars consider that Muslims can only keep dogs for certain purposes like hunting and guarding.
"Islamic scripture and tradition does not provide a definitive guide to all matters canine," Omar Sacirbey writes for the Huffington Post.
"While many Muslims believe scripture approves canine companions, many also believe scripture discourages Muslims from keeping dogs in their homes," Sacirbey adds.