The film opens with a scrolling shot of a marble wall: a tribute to all the officers killed in the line of duty in the city of San Francisco.
The shot of the wall fades into the silenced barrel of a rifle, and a long, dark-haired Caucasian man staring down it. Through the scope and the cross-hairs, we see his target: a young, beautiful blond woman, swimming in a rooftop pool. He follows her with his sights for a moment before pulling the trigger, hitting her in the back. She flails in agony in the water, and the pool slowly fills with her blood as she dies.
Inspector Harry Callahan (Clint Eastwood) enters the rooftop pool area as the title cards roll. Harry inspects the dead body and looks up to the probable area of the shooter. He walks down the street to the building and up to the roof. He walks over to where he figures the shooter was stationed, looks down and across the street at the pool. Looking down, Harry finds a shell casing. Using a pen, he carefully picks it up and places it in an evidence bag. As he stands, he sees a piece of paper speared on a television antenna. He reads it and realizes what it is.
In the mayor's office, the ransom note is blown up and put on a screen. The mayor reads out the demands of the sniper, dubbed "Scorpio". He demands $100,000 to stop his killing spree, or he "will target either a catholic priest, or a nigger". The mayor discusses his options with the police chief, and Callahan's superior, Lt. Al Bressler.
The mayor calls Harry in, and immediately asks what he's been doing. Harry angrily responds that he's been sitting on his ass in the mayor's office, then lays out the plan of investigation so far. Lt. Bressler announces that he's arranged for helicopter surveillance in probable target areas. To Harry's disbelief, the mayor agrees to lead Scorpio on for the time being, to post a message in the newspaper (per Scorpio's instructions) as if they plan to pay him. Before leaving, the Mayor tells Harry that he doesn't want the same kind of trouble that Harry's caused in the past. Harry responds that he was trying to stop a rape, and, again with sarcasm, shoots down the Mayor.
Across from a bank, Harry sits down for a hot dog lunch. He asks the cook behind the counter if the car across the street, in front of the bank, is still running. The cook says it is, and Harry tells him to call the police - there is an armed robbery in progress at that bank. No sooner does he say this than the banks alarms go off and gunfire erupts. Harry takes a bite of his hot dog, swears, and then heads out to face the robbers. He orders one man to freeze, and the man shoots at Harry with a shotgun, who returns fire. The men in the car speed toward Harry, but he shoots into the windshield, causing them to crash into a fire hydrant and flip the car over. One man jumps out and shoots at Harry, who shoots back and kills him. He looks down at his leg, shot and bleeding, but he seems unaffected.
Harry strolls through the spraying water of the fire hydrant, to the wounded man by the entrance of the bank. The man slowly tries to move toward his dropped shotgun, and Harry makes his famous "six-shots-or-only-five" speech. The man cowers and surrenders. Harry picks up the shotgun, and the robber stops him. "Hey I gots to know." he asks. Harry raises his .44 Magnum and pulls the trigger. Harry fooled the wounded robber into giving up. The gun is empty.
In the hospital, Harry has his wounded leg looked at by a doctor. During the process of treatment, the doctor tells Harry to have his wife to help treat his wound, but stops himself mid-sentence and apologizes.
In the air, a police helicopter is making the rounds over the city.
The next day, Harry walks through the department and meets with the captain, who congratulates Harry on stopping the robbery. The captain announces that he's saddling Harry with a new partner, and introduces Chico Gonzales. Harry gripes about not wanting a partner, and that his partners always wind up in the hospital, or dead. But the captain is unmoved and tells Harry that he doesn't have a choice.
Harry and Chico walk and talk for a while, before stopping to talk with another cop, DiGiorgio. Chico warily asks how Harry got his nickname Dirty Harry. DiGiorgio fills him in, explaining that Harry is an equal opportunity bigot, hating every ethnicity equally. Chico asks how he feels about Mexicans, and Harry responds that he hates them especially.
Somewhere in the city, Scorpio is on another rooftop, across from a church, reading the personal ad that contains the city's response to his ransom. Unhappy with the be patient message, he tears up the paper, and walks to the roof's ledge. He opens his rifle case and begins spying down on the neighborhood through his scope. He sees a black man walking on the street and places the cross hairs on him. Scorpio follows him for a while, and then hastily puts his rifle together. Before he can take his shot, though, the police chopper spots him and he is forced to retreat.
That night, Harry and Chico are riding through the city, complaining about how the chopper cops lost Scorpio. Over the radio, they hear a description of the sniper, and Chico immediately spots a man fitting the description and carrying a tan suitcase. They turn around to follow him, but eventually split up, with Harry inconspicuously pursuing him on foot.
Harry walks down an alley and spies the man walking into an apartment. He climbs up on a trashcan and looks into the apartment window. The man's suitcase is only holding lingerie for his girlfriend, Hot Mary, who is walking around the apartment topless. Harry realizes this is not Scorpio, but is suddenly attacked from behind by a couple of men who thought he was a peeping tom. They smack Harry around a bit, before Chico stops them. Harry tells him to let the guys go, though, and Chico makes a joke about why the other officers call him Dirty Harry.
Back in the car, Harry and Chico get a call from an officer who spots a man on a roof, and they take off in that direction. It turns out the man is not Scorpio, but instead, he's a suicidal jumper. Without much hesitation, Harry climbs into a crane bucket and rides up to the roof, to confront the man. The jumper immediately tells Harry to stay away, and Harry tells the man he's going to keep his distance: jumpers sometimes decide to take someone with them when they die. A grotesque story follows, about a fellow officer who was killed like that. Harry includes all the gory details causing the man to become sick. Angered, he attempts to grab at Harry, but Harry's quicker and punches him out, cuffs him to the rails on the crane bucket and brings him down. On the street, Harry tells Chico he got his nickname by taking "any dirty job that comes along".
The next day, Harry and Chico are called to the site of a dead body: a young black kid is found shot in the head. As Harry and Chico are looking over the crime scene, the boy's mother tells them her son was only ten years old. Another officer finds a shell casing that confirms the boy was killed by Scorpio.
Harry has a meeting with the chief, and they discuss the plan to capture Scorpio. They will post highly-visible policemen all over the city at high probability targets, but no policemen near the site where the chopper had spotted him the day before. Harry and Chico will stake out the area, armed and ready to take Scorpio down if he appears. Chico expresses his doubts that Scorpio will target the same area twice, but Harry explains that he believes the sniper will want to take out a priest now.
That night, the two detectives are watching over the church. Harry tells Chico that the priest of the church volunteered to be bait for the murderer. With binoculars, Harry spies on the entire neighborhood, including a nude woman and her two male companions. As he's watching the party, he notices that one of the nearby roof doors is now open. Harry and Chico prepare to throw the spotlight on Scorpio, and Harry takes aim with his rifle. He fires, but misses. Scorpio fires on them with a machine gun but misses, destroying the lights. He laughs gleefully as he fires.
Harry and Chico rush downstairs, and across the street, where DiGiorgio kneels over the body of an officer that Scorpio apparently killed in his escape.
The next day, their captain tells Harry and Chico that Scorpio has kidnapped a 14-year-old girl, Ann Mary Deacon. His ransom note says that he's buried her alive, and has raised his ransom to $200,000, demanding it by 9pm. He threatens to let the girl suffocate to death if he's not paid. Harry insists that the girl is probably already dead, but Lt. Bressler tells him that the mayor has agreed to pay. He asks Harry to drop the money off, and tells Chico he's not allowed to help.
Chico responds, 'No wonder they call him Dirty Harry. Always gets the shit-end of the stick.'
Harry prepares for the drop by getting a microphone to put under his shirt, so that Chico can furtively follow him. Harry gets the money from the mayor's office. While the captain tells Harry that Scorpio will probably run Harry all over town before he drops the money, Harry tapes a switchblade to his ankle. The captain tells Harry to play it straight and not to try anything funny.
Harry arrives at the marina, the designated drop point, and answers a nearby payphone. Scorpio tells him he's going to give Harry a little exercise and intends to have him travel all over the city on foot to make sure he's not being followed. Hidden nearby in his car, Chico listens in. Scorpio instructs Harry to run to a nearby railroad station.
He makes it and answers the Scorpio's call. Harry next has to make a train that is leaving the station immediately. Barely making it, he jumps on and rides to the next checkpoint. Chico continues to follow. Harry answers the next call, and Scorpio laughs as he tells Harry that he's going to have a long run now.
While running, Harry is accosted by three thugs who try to take the money bag. It's a short delay, but Harry can't afford it, and he quickly beats the three goons down. He sprints to the phone, but a man answers it before Harry can. Scorpio hangs up, but calls back immediately, giving Harry instructions to run to a park and meet him there. Chico follows but keeps a safe distance.
Harry walks through the park, taking a look at everyone he passes. A young man that Harry thinks may be Scorpio turns out to be a male hustler, so Harry runs him off. He makes it to the top of the hill in the park, at the foot of a large stone cross. Scorpio shows up wearing a ski mask. Scorpio disarms Harry and starts to beat him. He tells Harry that he changed his mind and has decided to let the girl die, and now he's going to kill Harry, too. Before he can, though, Chico shoots at him, but misses. Scorpio and Chico exchange fire, and Chico is hit in the chest. Harry pulls the switchblade from his leg and plunges it deep into Scorpio's leg. Scorpio wails and limps off. Harry tries to shoot at Scorpio, but misses and then passes out from the beating. Scorpio makes it to a hospital.
In his office, the hot-headed Bressler is talking to the chief on the phone; the chief is not happy that Harry and Chico disobeyed orders. Harry tells Bressler he'll quit when this is over, if that's what the chief wants. They get a call from a doctor at an emergency room: the doctor reports treating a man with a stab wound in the leg.
Harry and DiGiorgio talk to the doctor who isn't very helpful at first. But he does remember that he had seen the man before. After a few moments he remembers that the man works as a groundskeeper at a nearby stadium. Harry and DiGiorgio climb the fence outside the stadium, and inspect the grounds in the dark of night. Scorpio spies on them and eventually takes off running. Harry chases him while DiGiorgio looks for a way to turn on the lights. Scorpio is running/limping across the football field, when Harry finally catches up to him, and DiGiorgio hits the floodlights.
Harry has his gun on Scorpio and fires hitting him in the leg. Scorpio sobs for help and Harry demands to know where the girl is. Scorpio yells that Harry tried to kill him, but Harry replies: "If I was trying to kill you, your head would be splattered all over this field!". Harry demands to know where the girl is. The psychopath Scorpio yells that he has rights and he wants a lawyer, but Harry angrily grinds his foot into the wound, as the scene pulls up and away from the two men in Kezar Stadium.
At dawn, Harry stands on a hilltop overlooking the golden gate bridge. Behind him, officers are pulling the dead body of Ann Mary Deacon out of the ground.
Harry is called to a meeting with the District Attorney. He is shocked and disgusted that the DA is going to release Scorpio, because Harry's search of the killer's home was illegal (the issue of probable cause is never brought up). A local by-the-book judge backs up the D.A.'s claim, and the D.A. condescendingly chastises Harry about the suspect's rights. Harry fumes and wants to know about the rights of the victims, but the arrogant and unfeeling D.A. does not care. "That's the law", he says, and Harry retorts: "Then the law is crazy!"
As he's leaving, Harry says that as soon as Scorpio slips up, Harry will be there to arrest him. The D.A. warns that he won't stand for harassment. Harry says that Scorpio is a sociopathic con artist and he will not stop his killing spree, as "he likes it too much".
Scorpio walks into a park in the middle of the day, and immediately notices Callahan following him. Sitting in a stag bar, he sees Harry watching him.
The next day, Scorpio meets with a tough looking black guy in a run-down factory. The other man makes sure Scorpio wasn't followed and then leads him to a back room, where he takes payment from Scorpio: $200 for the man to beat Scorpio to a pulp. He sits him in a chair and then begins punching him in the face. He lands several heavy blows, but eventually grows dubious and stops. Scorpio taunts him with racist remarks and the man kicks him in the face. Realizing that his victim is insane, he kicks Scorpio out.
The next scene shows him being wheeled down the hall of a hospital, enthusiastically talking to reporters and blaming the San Francisco police for his beating. He falsely singles out Harry as the main culprit.
The chief meets with Harry, but Harry says he looks too damn good to have caught a beating from Harry himself. The chief orders Harry to stop tailing Scorpio. Harry leaves with a scoff.
Harry visits Chico at the hospital, where he is sitting outside with his wife. Chico tells Harry that he's not coming back to the department. He is going to be a teacher instead. Chico is wheeled off to physical therapy, leaving Harry and Mrs. Gonzalez to chat for a while.
They walk out of the hospital, and Chico's wife tells Harry that she feels responsible for his leaving. She tells him that she got nervous every time Chico left, and asks Harry if his wife felt the same. Harry says no. He tells her that his wife died in a drunk-driving accident some years ago. Harry tells Chico's wife that he understands why Chico is leaving the police force. When she asks him why he stays in the job, Harry says, "I don't know. I really don't".
Later that night, the killer Scorpio enters a liquor store and chats with the shopkeeper. To explain his beaten face, he makes up a lie about hitting his wife and being beaten by her brother. He asks the owner about his being robbed before, and the owner admits to shooting and killing the last two robbers. He brags and shows off his pistol to show Scorpio. Scorpio instantly smashes a bottle over the shopkeeper's head and takes the gun.
The next scene shows a school bus dropping children off at the end of the school day. Scorpio climbs into the bus pretending to be a school bus inspector. When the driver tries to stop him, Scorpio pulls the gun on her. He tells her to start driving, he'll direct her. He then turns his attention to the kids, making them sing.
At city hall, Harry's captain watches as Harry arrives. As he and the captain walk up to the mayor's office, they discuss a new note from Scorpio. They enter the mayor's office, while the mayor is preparing a jet for the killer. The mayor then takes a call from Scorpio, who informs them of the bus hostage situation. He forces the bus driver to confirm. He demands his jet and $200,000, and tells mayor he intends to take the bus to the airport. The mayor foolishly tells Scorpio that he won't be harmed. The chief asks Harry to take the money, but when they order him to just make the drop without trying to stop Scorpio, he refuses, telling the arrogant mayor, "Go find yourselves another delivery boy".
Back on the bus, Scorpio has the children maniacally singing "Row, row, row your boat", but eventually the children become whiny, wanting to get home. Scorpio quickly loses patience, slapping one boy, and scaring the children even more. He gives the bus driver more directions, and has her exit the highway. They are headed for an underpass, and Scorpio panics when he sees Harry standing on top of the bridge, waiting for him. Harry jumps on the roof, and Scorpio starts shooting up at him, causing the bus driver to faint. Scorpio takes the wheel, and swerves the bus all over the road, trying to throw Harry off.
He crashes the bus through a fence, sending Harry flying into a mound of sand. Scorpio jumps out of the back emergency exit and flees to a nearby mill. Harry chases him. While running, they exchange gunfire, and once again, we lose track of how many shots Harry has fired. Harry is gaining on Scorpio, so he tries to ambush him, but Harry ducks and Scorpio misses. Scorpio runs out the back of the mill, and to a small dock, where a boy is fishing.
With Harry not far behind him, Scorpio (ruthless to the last) grabs the boy and puts the gun to his head, yelling at Harry to drop his gun. Harry drops his arm to his side, but quickly brings it back up and shoots Scorpio in the shoulder, knocking him backwards. The boy escapes and quickly runs away.
Scorpio tries to reach for his gun, but Harry stops him and points his revolver at the killer. He repeats his speech from earlier, but his wry grin is gone this time, replaced with fury.
"I know what you're thinking, punk. You're thinking, did he fire six shots, or only five? Now, to tell you the truth, I forgot myself in all this excitement. But being this is a .44 Magnum, the most powerful handgun in the world and it'll blow your head clean off! You've gotta ask yourself a question. Do I feel lucky? Well, do you, punk?"
Scorpio thinks for a moment, then giggles madly and stupidly reaches for his pistol. Harry fires, shooting Scorpio in the chest. The psychopathic killer falls into the water and floats there, dead. Scorpio had unwisely called Harry's bluff - and paid for it with his life.
Sirens wail in the distance. Harry takes out his badge. He pulls his gold star out of the leather fold and looks at it for a moment before throwing it into the water. The camera pans away from Harry as he walks away and the credits roll.