William Peter Blatty, the novelist and Oscar-winning screenwriter most famous for landmark horror film “The Exorcist” as well as the director of two films, “The Ninth Configuration” and “The Exorcist III,” died Thursday in Bethesda, Maryland. He was 89.

“Exorcist” director William Friedkin announced the news on Twitter Friday morning: “William Peter Blatty, dear friend and brother who created The Exorcist passed away yesterday,” Friedkin wrote.

Blatty’s 1970 novel “The Exorcist” remained on the New York Times bestseller list for 57 weeks, and he subsequently adapted it for the 1973 bigscreen version directed by William Friedkin. That film was not only an enormous box office success, playing in theaters for months, but was Oscar nominated for best picture (becoming the first horror film ever so nominated) and won for Blatty’s adapted screenplay.

The film won several polls for scariest horror movie ever, and the Library of Congress designated “The Exorcist” for preservation as part of the National Film Registry in 2010.

The TV series based on the story began its first season on Fox in September 2016.

Blatty was an experienced screenwriter by the time he wrote the “Exorcist” screenplay. He had worked with Blake Edwards on a number of films: two comedies, “Pink Panther” sequel “A Shot in the Dark” (he and Edwards adapted a play by Harry Kurnitz) and Edwards’ “What Did You Do in the War, Daddy?,” plus “Gunn,” an adaptation of the “Peter Gunn” TV series that he co-wrote with Edwards, and Julie Andrews-Rock Hudson starrer “Darling Lili,” a romantic drama that he also co-penned with Edwards.

Blatty’s other film credits prior to “The Exorcist” were broad political comedy “John Goldfarb, Please Come Home!,” starring Shirley MacLaine and Peter Ustinov, adapted from Blatty’s novel of the same name; Arthur Hiller’s romantic comedy “Promise Her Anything,” with Warren Beatty and Leslie Caron; and comedy Western “The Great Bank Robbery,” with Zero Mostel and Kim Novak.

Blatty was uninvolved in the production of John Boorman’s 1977 sequel “Exorcist II: The Heretic,” which was critically drubbed.

In the late 1970s, however, he had reworked his 1966 novel “Twinkle, Twinkle, ‘Killer’ Kane,” which was republished under the name “The Ninth Configuration,” and he subsequently adapted the material for the bigscreen and directed the 1980 film, a surrealistic thriller centered on a castle in the Pacific Northwest housing insane members of the armed forces and the new officer, played by Stacy Keach, who leads the unit. It failed at the box office but has since attained a cult following.

Blatty’s novel “Legion,” a sequel to “The Exorcist,” was published in 1983, and he adapted the book into the film “The Exorcist III,” which he also directed and produced. “Exorcist III” drew fairly positive reviews, with Vincent Canby of the New York Times declaring, “This may sound like heresy, but ‘The Exorcist III’ is a better and funnier (intentionally) movie than either of its predecessors.” It was also a modest box office success.

Blatty was uninvolved with the two subsequent “Exorcist” films: 2004 prequel “Exorcist: The Beginning,” a reworking by director Renny Harlin of Paul Schrader’s “Dominion: Prequel to the Exorcist,” made earlier but released in 2005. Blatty described “The Beginning” as his “most humiliating professional experience” but said that “Dominion” is “a handsome, classy, elegant piece of work.”

Blatty was born in New York City to parents who had immigrated from Lebanon. After a stint in the Air Force, he entered the Foreign Service, serving as editor of News Review, a United States Information Agency publication, in Beirut. He graduated from Georgetown U. (whose environs later become the setting for “The Exorcist”), then received a master’s in English literature from George Washington U. in 1954.

While nursing a nascent writing career, Blatty worked in PR, serving as public relations director at Loyola U. of Los Angeles and then at USC. To gather material for a humorous article to be published in the Saturday Evening Post, he went about meeting movie stars while masquerading as a Saudi Arabian prince, then appeared as a contestant on Groucho Marx quizshow “You Bet Your Life,” winning $10,000 — money that allowed him to write full time.

His first novel, “Which Way to Mecca, Jack?,” was published in 1960.

Blatty and director Friedkin sued Warner Bros. in 2001, claiming they had been denied their fair share of profits from a reworking of “The Exorcist.” In 1986 the author sued the New York Times, claiming that the paper had negligently omitted his novel “Legion” from its bestseller list, damaging sales of the book.

Blatty autobiography “I’ll Tell Them I Remember You” was published in 1973, and his memoir “If There Were Demons Then Perhaps There Were Angels: William Peter Blatty’s Own Story of the Exorcist” was published in 1978.

Survivors include his wife, Julie.