The plot of this movie was inspired by the death squads of Brazil that were in the news at the time. John Milius pitched Clint Eastwood a scenario of Harry Callahan similarly encountering a corrupt police force of vigilantes assassinating those they could not convict. Eastwood liked the idea, particularly since he wanted to address the controversy caused by the original movie, Dirty Harry. Some viewers and critics believed that it supposedly endorsed fascism and vigilantism. Eastwood wanted to make it clear that Harry was not a vigilante.
Albert Popwell, who played the pimp, appeared in the first four "Dirty Harry" movies with Clint Eastwood. He portrayed a different character in each movie. He was the bank robber in Dirty Harry (1971), the pimp in this movie, a black militant leader in The Enforcer (1976), and Harry's partner Horace in Sudden Impact (1983). Prior to this, Popwell also appeared alongside Eastwood in the 1968 action film Coogan's Bluff.
According to screenwriter John Milius, the sex scene with the Asian woman "Sunny" (Adele Yoshioka) is in the script because Clint Eastwood received many fan letters from Asian women that contained sexual propositions.
When Clint Eastwood approached Don Siegel to offer him the directing job for Dirty Harry (1971), Eastwood gave Siegel four drafts of the script, one of which was written by Terrence Malick. Malick's script changed the killer from being a mindless psychopath who killed because he likes it to being a vigilante who killed wealthy criminals who'd escaped justice. Siegel didn't like Malick's script, but Eastwood did. Malick's ideas formed the basis for this movie, the second entry in the Dirty Harry film franchise.
David Soul's performance as Officer John Davis, one of the vigilante cops, led to his being cast as Detective Ken Hutchinson in the classic cop series Starsky and Hutch (1975).