Peter Straub, whose literary novels of terror, mystery and the supernatural placed him in the top ranks of the horror-fiction boom of the 1970s and '80s, alongside writers like Ira Levin, Anne Rice and his close friend and collaborator Stephen King, died Sunday in New York City. He was 79.

His death, at Columbia University Irving Medical Center, was caused by complications after breaking a hip, his wife, Susan Straub, said.

Peter Straub was both a master of his genre and an anxious occupant of it. Novels like "Julia" (1975) and "Ghost Story" (1979) helped revivify a once-creaking field, even though he insisted that his work transcended categorization and that he wrote how he wanted, only to watch readers and critics pigeonhole him as a horror novelist.

Not that he could complain about what critics and readers thought. Starting with "Julia," his third novel, about a woman who is haunted by a spirit that may or may not be her dead daughter, Straub won praise from reviewers and topped bestseller charts with a type of story that had previously been sidelined as sub-literary.

"He was a unique writer in a lot of ways," King said in a phone interview Monday. "He was not only a literary writer with a poetic sensibility, but he was readable. And that was a fantastic thing. He was a modern writer, who was the equal of say, Philip Roth, though he wrote about fantastic things."

Straub, who counterposed the darkness of his texts with a peppy personality and a preppy wardrobe of bright shirts and bow ties, took up horror fiction at the right time. Starting with Levin's "Rosemary's Baby" (1968) and William Peter Blatty's "The Exorcist" (1971), the genre was becoming mainstream. King's first novel, "Carrie," appeared in 1974, the year before "Julia"; Rice's debut, "Interview With the Vampire," came out in 1976.

A fan of Henry James and John Ashbery — he had published several chapbooks of poetry before turning to novels — Straub did not originally aspire to write about the supernatural; in fact, he turned to it only after two more conventional novels went bust." 'Julia' was a novel that involved what turned out to be a ghost, so it was a horror novel," he told The Milwaukee Journal-Sentinel in 1996. "I didn't know much about the field at that time. I just wanted very much to write a novel that would make money so I wouldn't have to get a job. With the first sentence, I felt this enormous relief. I felt at home right away."

"Julia" did in fact make money, as did his next two novels, "If You Could See Me Now" (1977) and "Ghost Story," a New York Times bestseller. Both "Julia" and "Ghost Story" were adapted for films, the former as "Full Circle" in 1977, starring Mia Farrow, and the latter in 1981, starring Fred Astaire, Melvyn Douglas, Douglas Fairbanks Jr. and John Houseman.

Like James and Edgar Allan Poe, another of his influences, Straub kept the supernatural subdued, implied but not always recognized, and if so only toward the end of a story, when eerie uncertainty has raised the suspense to a boil.

"I wanted to take the genre and pull it upstairs a little bit," he told the Times in 1979, about writing "Ghost Story." "Not exactly transcend the genre, but make a little more of the material than has been made of it in the recent past."

By then he was friends with King, who agreed to write a blurb for "Ghost Story" after reading an unbound advance copy.

"We got it at the post office," King recalled. "It was all kind of split open. And so I was driving and my wife opened it and she started to read it to me. And by the time we got back to our house, we were both really excited, because we knew that this was really sort of a masterwork."

It was Straub who, in the early 1980s, suggested that he and King team up to write a novel — on modem-linked computers and dot-matrix printers, state-of-the-art technology for the time. King, by then a mega-bestselling author, said yes immediately, mostly out of admiration for his friend's writerly strengths.

"He was a better and more literary writer than I was," he said.

Their collaboration, "The Talisman" (1984), was an enormous hit. It told the story of Jack Sawyer, a 12-year-old who ventures into an alternate universe to save his cancer-ridden mother. Reviews were mixed, but sales weren't: The book spent 12 weeks at the top of the Times's bestseller list.

King and Straub reunited in 2001 to write a sequel, "Black House," which picks up with Jack Sawyer as an adult. It, too, sold very well. They were discussing a third book, but it was still in its earliest stages at Straub's death.

Peter Francis Straub was born March 2, 1943, in Milwaukee to Gordon Straub, a traveling salesman, and Elvina (Nilsestuen) Straub, a registered nurse.

When he was 7 he was hit by a car and nearly killed. He had to learn to walk again, and the experience left him with a pronounced stutter that he overcame but did not entirely vanquish, so that even later in adulthood it crept back whenever he grew excited.

Peter Straub studied English at the University of Wisconsin-Madison, where he lived across the street from future rock star Steve Miller. He graduated in 1965. He went on to receive a master's degree from Columbia University, also in English, and a year later returned to Milwaukee, where he taught English at a private school. He married Susan Bitker in 1966.

Along with his wife, he is survived by his daughter, novelist Emma Straub; his son, Benjamin, who works for a production company that represents his father's film interests; his brother, John; and three grandchildren.

The Straubs moved to Ireland in 1969 so that Peter Straub could pursue a doctorate in English at University College Dublin, but instead of finishing his dissertation (originally about D.H. Lawrence, it later transmogrified into a treatise on the Brönte sisters), he wrote his first novel.

On a lark he submitted the novel, "Marriages," to a London publisher, who accepted it immediately. He was unhappy with the quality, and much happier with a short run of poetry books he published with a small British press. Neither prose nor verse made him much money, though, and in desperation he turned to writing about the supernatural instead.

He and his wife moved to London in 1972, and then to the New York area in 1979. They lived in Brooklyn at his death.

Although he was hardly as prolific as King, Straub continued to write bestselling books, not all of which involved horror. His "Blue Rose" trilogy — "Koko" (1988), "Mystery" (1990) and "The Throat" (1993) — revolve around the hunt for a serial killer. Although there is nothing supernatural about them, each book won a Bram Stoker Award from the Horror Writers Association, three of seven Stoker prizes that Straub accumulated.

If he was loath to embrace the horror label wholeheartedly, he held it in high esteem for its ability to surface the often unspoken fears and unrecognized tragedies of real life.

"I like its acknowledgment that life is a dodgy and uncertain business, and a monster with a smiling face may live or work right next door to you," Straub told Publishers Weekly in 2016. He added, "Adult human beings live with the certainty of grief, which deepens us and opens us to other people, who have been there, too."