While vacationing in Puerto Vallarta in fall 2008, USC professor Deborah Harkness, a historian of science, was consumed with the upcoming bicentenary of Charles Darwin's birth, but the rest of the world, including the airport in the Mexican resort city, was gripped by a madness spread by vampires: The last of Stephenie Meyer's four "Twilight" novels had just been published.

"To walk through the airport was to be hit with vampires, witches, ghosts and demons at every angle in the bookstores," says Harkness, a good-humored and enthusiastic woman of 46, over a cappuccino in Pasadena.

"It was so huge — it seemed to me much bigger than what had happened with Anne Rice. And as a historian of science, trapped in Puerto Vallarta during what turned out to be the rainy season, I thought, 'Why do these creatures still exert such a pull on us?' "

The whole thing felt to her like a throwback — a throwback of 450 years. "People believed that the supernatural and the natural existed, intermingled. We think of ourselves as having very little in common with people in 1558. And yet there were walls of this stuff. What if 16th century people were right, and the supernatural and natural coexisted? How would that play out? It started out almost like a kind of logic problem."

The result of her inquiry is her first novel, "A Discovery of Witches," which starts out in a contemporary England in which witches, vampires, daemons and humans fight for good light in Oxford University's libraries and even sometimes attend the same yoga class. Humans know about these creatures but keep their distance: There's an uneasy detente, with stereotypes, wariness and even bigotry in the mix.

But mostly, life goes on, until the novel's scholarly protagonist and primary narrator, Diana Bishop, comes across an elusive medieval document, long thought lost, which might hold the secrets of eternal life. And Diana attracts not only the attention of a host of pesky creatures but the dark eyes of a brilliant and terrifying vampire whose quiet charisma she works hard to resist.

The subject of intense interest by publishers worldwide at the 2009 Frankfurt Book Fair, "A Discovery of Witches" is now, two months after publication, already in its seventh printing. Entertainment Weekly's Karen Valby calls it "a thoroughly grown-up novel packed with gorgeous historical detail" and "a gutsy, brainy heroine to match." It's also become a New York Times bestseller, debuting at No. 2.

And though comparison to Meyer's vampire novels and the misty-spired fantasy England of the Harry Potter books are inevitable, Harkness has not — for the last two decades or so — read much fiction written after the death of John Milton.

Instead, the novel comes directly out of her work as a historian. She studies the transition from the superstitious Middle Ages to the rational, science-loving Enlightenment, which moved to banish the supernatural from its worldview. (Her novel's protagonist describes her era as "the age when astrology and witch-hunts yielded to Newton and universal laws.")

Some things about writing a novel came naturally for Harkness. She's written two previous scholarly books of history, both driven by historical figures and narrative.

"I'm a storyteller," she says of an impulse shared by her scholarship and fiction writing. "And I have really good material to work with: I'vebeen studying magic and the occult since about 1983." Overall, she says, trying to graft a 16th century worldview onto a 21st century setting — with characters, conflict and romance — was "a gas."

Some of the muscles used by historians and novelists, though, are quite different. "As a historian you can only go as far as the evidence will take you. I needed to be able to shed that, to let the history serve the story rather than have the history bind the story. You have to rewire your brain, in a way."

The mysterious document that catalyzes a lot of the action in "A Discovery of Witches" shows how differently a historian and novelist operate. "It really exists," she says of the alchemy chronicle known as Ashmole 782, one of a large cache of manuscripts collected and cataloged by 17th century bibliophile and alchemy enthusiast Elias Ashmole. "It really is lost — I've looked for it; that's its real title. This is the perfect jumping-off point for a novel. I can either be frustrated as a historian or intrigued as a storyteller."

Harkness grew up in the countryside outside Philadelphia, the bookish daughter of a paint-store manager and a British-born secretary. As a kid, her favorite writer was Louisa May Alcott, and most of her limited excursions into fiction writing as a child involved trying to ape Alcott's style. In a natural extension of her family's humble European origins — and of her years teaching at UC Davis, with its proximity to California's wine country —- she runs the blog Good Wine Under $20. http://goodwineunder20.blogspot.com/ And she visited England just often enough as a kid for the dreary isle to maintain its magical shimmer.

With its conflicted protagonist — Bishop is descended from a witch executed at Salem and struggles to resist her own magic powers — and a richly imagined world, "A Discovery of Witches" has a great deal of dimension to it. So much so that it's the first of what's imagined as a trilogy. (Harkness says she's finished about a third of the second book.)

Her editor at Penguin, Carole DeSanti, says no one at the press told Harkness that the author's universe should be confined to a single novel. "Talking through it, she seemed to have a clear starting and ending point and lots of fascinating places to go along the way," DeSanti says. "There's a certain strength of purpose an author can come in with. What we're looking for in a fiction writer is a major commitment — people who are in this for the long term and a set of narrative material that sustains them."

Sustenance that seems to have found an eager audience — readers who love fantasy, a strong plot and serious intellectual backbone and have enjoyed the likes of Susanna Clarke, Neil Gaiman and Philip Pullman. Harkness suspects the current craving for this kind of material comes from our disenchanted times.

"A lot of our assumptions of the world are fairly cynical, fairly negative, and assume the worst," she says. "What our reading tastes show — in this rush to fantasy, romance, whatever — is that we actually still want to believe in a world of possibility, in a world of mystery."