Joe Spinell's character of "Spinell", a patient at the castle-hospital, was not in the novel nor the original script. Spinell had begged writer and director William Peter Blatty, a close friend of his, to cast him in a small role as the sidekick to Jason Miller's character of Lieutenant Reno. Since there was no part for Spinell in the movie, his character was given the same last name. Nearly all of Spinell's dialogue was ad-libbed.
William Peter Blatty has said that he considers this movie to be the true sequel to L'Exorciste (1973) as opposed to a mere follow-up. The novel and film of "The Exorcist" deals with the existence of both good and evil, "The Ninth Configuration" deals with the mystery of good, and the third novel, "Legion", deals with the human's punishment of evil for original sin. Captain Cutshaw is the same astronaut whom Regan warns "You're gonna die up there" in "The Exorcist". book. However, in the Exorcist film, the astronaut is never mentioned by name (not even in the credits).
The film was partially financed by Pepsico, the makers of soft drinks such as Pepsi. The company had leftover funds that couldn't leave the country of Hungary and to use them, they decided to co-finance the film. Both Pepsi and the director had clauses: Pepsi's was to shoot the film in Budapest; Blatty's was to not have any product placement by the company. Both agreed to the terms, although Blatty slightly relented: a Pepsi machine does appear briefly in one scene.
According to Jason Miller and actor Richard Lynch in the documentary "The Joe Spinnell Story", one night during filming, several of the actors were out drinking. They ended up getting into a bar fight with some (East) German soldiers, and were arrested. They were the only prisoners in the jail. At one point, the cops recognized Joe Spinell from Le Parrain (1972). He ended up charming them with stories of the film.
The film was originally written to be much longer and would delve into the backstories of the various inmates and reveal why they had been driven insane or pretended to be insane. One such backstory for Captain Bennish, played by Robert Loggia, would have shown him and his platoon were helping refugees out of Vietnam, only for an elderly woman a young corporal was helping turn out to be a Vietcong agent who blows up the young marine with a grenade, his blood splashing all over Bennish's face, leading to his mental breakdown. These flashback scenes were dropped after William Peter Blatty couldn't get backing from any major film company or enough funds from investors.