Poet and novelist Sam Greenlee in 1973. His movie, “The Spook Who Sat by the Door,” based on his book by the same name, became a classic in the black nationalist movement. (AP)

Sam Greenlee, a onetime Foreign Service officer whose 1969 novel and a subsequent film, both called “The Spook Who Sat by the Door,” became underground sensations during the black nationalist movement, died May 19 at his home in Chicago. He was 83.

The death was confirmed by a friend, Chicago-based filmmaker Pemon Rami, who did not cite a specific cause.

Mr. Greenlee joined the U.S. Information Agency in 1957 and was among the its first black officials to serve overseas. He was stationed in Iraq, Pakistan, Indonesia and Greece before quitting in 1965 to focus on writing.

In his novel, Mr. Greenlee drew on his work with USIA but transformed the central character in “The Spook Who Sat by the Door,” Dan Freeman, into a black CIA officer who quits the spy agency in disgust. Freeman returns to his native Chicago, where he puts his CIA training to use by organizing street gangs into a paramilitary black revolutionary movement that spreads nationwide.

“My experiences were identical to those of Freeman in the CIA,” Mr. Greenlee told The Washington Post in 1973. “Everything in that book is an actual quote. If it wasn’t said to me, I overheard it.”

Mr. Greenlee’s novel was first published in England in 1969, after, he said, it was rejected by dozens of mainstream publishers in the United States.

Four years later, after he and another writer completed a screen adaptation, “The Spook Who Sat by the Door” was made into a film, directed by Ivan Dixon. Dixon was best known for playing the role of Sgt. Kinchloe on the 1960s situation comedy “Hogan’s Heroes.”

The film’s soundtrack was composed by jazz pianist Herbie Hancock, and most of the funding came from African Americans.

“The Spook Who Sat by the Door” had a short theatrical release in 1973, during the era of “blaxploitation” movies such as “Shaft,” “Super Fly” and “Black Caesar.” The films emphasized violence, eroticism and lively music as black action characters triumphed over an oppressive social system.

As a work of cinematic art, “The Spook Who Sat by the Door” received lukewarm reviews.

“It’s not a very well-made movie, and is seldom convincing as melodrama,” critic Vincent Canby wrote in the New York Times. But he and others recognized the raw power and urgency of the message, which Canby described as “a mixture of passion, humor, hindsight, prophecy, prejudice and reaction.”

When the film was taken out of theatrical circulation by its Hollywood distributor, United Artists, Mr. Greenlee contended it had been suppressed by the FBI because of its incendiary message of armed black insurrection. For more than 30 years, it remained strictly an underground phenomenon, seen only in grainy, bootleg copies.

“I’ve been bootlegging it myself out of my shoulder bag,” Mr. Greenlee told the New York Times in 2004, when a new video version of the film was released.

“It’s got a tremendous place in African American film history,” Christine Acham, a scholar of film and African American history at the University of Southern California, said Tuesday in an interview.

In 2011, Acham was the co-director, with Clifford Ward, of a documentary that examined the fate of Mr. Greenlee’s film, “Infiltrating Hollywood: The Rise and Fall of ‘The Spook Who Sat by the Door.’”

Acham said she investigated Mr. Greenlee’s most alarming accusation, that the FBI had ordered the film to be withdrawn from theaters.

“People who ran theaters had face-to-face confrontations with people who claimed they were from the FBI,” Acham said, “and told them to stop showing the film. What happened around ‘Spook’ was really devastating to Sam.”

The only pristine print of the film was found in a vault, where the director, Dixon, had filed it under a false name. Only in the past decade has the movie been returned to mass circulation.

In 2012, “The Spook Who Sat by the Door” was named to the National Film Registry of the Library of Congress as one of the country’s “culturally, historically, or aesthetically significant films.”

Samuel Elder Greenlee Jr. was born July 13, 1930, in Chicago. He received a bachelor’s degree in political science from the University of Wisconsin at Madison in 1952, served as an Army officer and studied international relations at the University of Chicago before joining USIA.

Mr. Greenlee published a second novel, “Baghdad Blues,” in 1976, drawn from his experiences in Iraq during the late 1950s.

His marriage to Nienke Greenlee ended in divorce. Survivors include a daughter from a longtime relationship with Maxine McCrey, Natiki Montano of New York; and a granddaughter.

Mr. Greenlee lived in Ghana and Spain for years before returning to his native Chicago in the late 1980s. He taught screenwriting at Chicago’s Columbia College, was the host of a radio talk show, wrote poetry and completed an autobiography shortly before his death.

He also wrote several screenplays that were never produced, said Rami, the filmmaker who noted “The Spook Who Sat by the Door” endures as Mr. Greenlee’s lasting achievement.

“It has never gone away,” he said. “It’s still a cult favorite after all these years.”