A few months after adopting a kitten, David Grimm and his fiancee huddled late one evening in the waiting room of a Towson emergency vet.

Jasper, their normally rambunctious gray-and-white kitten, was suffering from acute kidney failure. Although the couple had only had Jasper for a short time, he had become a member of their family. Facing the prospect of his death was devastating.

Grimm looked around the waiting room. Families were keeping the sorts of grim vigils usually associated with hospital emergency rooms. They were sobbing on the phone or pulling out two credit cards to pay hefty bills.

In those worried hours, Grimm hatched the idea for his book, "Citizen Canine: Our Evolving Relationship with Cats and Dogs," which was published by PublicAffairs Books this month. Grimm, a deputy news editor at Science magazine who holds a doctorate in genetics from Yale, will read from the book Tuesday night at the Ivy Bookshop.

Grimm explores the changing social and legal status of pets, which have been granted unprecedented protections in recent years — including, in the case of one elderly golden retriever, a court-appointed lawyer.

"As cats and dogs have become members of our families, society as a whole has really started to regard animals as quasi-citizens," said Grimm, sitting in the courtyard of his Bolton Hill home on a recent sunny morning.

Americans keep 150 million cats and dogs as pets, about one for every two people, Grimm writes. More than 90 percent of people consider their pets to be members of the family, and 83 percent refer to themselves as their pets' parents. Half of pet owners said they would be "very likely" to risk their lives to save their pets, Grimm writes.

We don't hesitate to spend money on our pets. Americans spent $55 billion on them in 2013 — which makes the $3,000 that Grimm and his now-wife spent on Jasper seem like a drop in the bucket.

Fortunately, Jasper pulled through his ordeal. Along with his sister, Jezebel, the cat mewed at the screen door last week as Grimm explained the eight years of work that went into his book.

Grimm sat face to face with a wolf at a Colorado sanctuary, close enough to feel the beast's breath on his face. He observed a Yorkshire terrier's ability to interpret the human mind at Duke University's Canine Cognition Laboratory and met with New Orleans women who rescued hundreds of pets during Hurricane Katrina.

He interviewed the pioneers of the rapidly growing field of animal law and detailed the origins — and ramifications — of veterinary malpractice cases. And he met lots of animals: dogs that accompanied troops in combat zones, highly trained police dogs and cats that comfort residents of nursing homes.

Here in Maryland, Grimm met with people on both sides over the spirited debate over pit bulls that began when the state's highest court declared that the dogs were "inherently dangerous" in 2012.

The decision touched off two years of legal wrangling that culminated this month with the General Assembly passing a law that effectively overturned the high court's ruling — a major victory for pit bull advocates.

Grimm spoke with the father of a boy mauled by a pit bull and a pit bull owner who was nearly evicted after her complex banned the dogs.He joined in a "Pit Bulls on Parade" event with the members of the advocacy group B-More Dog at the Inner Harbor.

"I don't think there's any difference between them and any other breed of dog," he said. "It could just as easily have been golden retrievers. The pit bulls I've met have been sweethearts."

Indeed, pit bulls are just the latest dogs to be vilified, Grimm writes. Bloodhounds, Saint Bernards, German shepherds and even collies have gone through periods of being portrayed as vicious killers.

Our relationships with dogs have gone through many transformations since the first wolves began feasting on bones and scraps at the edges of human settlements. Recent research shows that early dogs emerged from wolves as long as 32,000 years ago, about 20,000 years earlier than previously thought, Grimm writes.

Cats likely tiptoed into human society some 10,000 years ago, following mice to early agricultural settlements. Since cats have spent 20,000 fewer years with humans, that could explain why they seem a little wilder than dogs, Grimm said.

The status of cats has fluctuated wildly since those early days. Cats were deified in ancient Egypt, then nearly driven into extinction in Europe in the Middle Ages after Pope Gregory IX declared them demonic.

"They've been suffering for 800 years from this bad press," said Grimm.

It was the invention of kitty litter in the 1940s that first allowed cats to permanently move indoors and be seen as members of the family, he said. A more recent invention — the viral Internet video — has done wonders by depicting the quirks that endear cats to their owners, he said.

Grimm believes that our increasingly isolated lives, marked by a dependence on technology and an immersion in virtual worlds, have pushed pets into a more central role than ever before in human history.

"There's a big emotional void in our lives, and dogs and cats have filled that," he said. "They keep us anchored to the physical world."