As Mills and Somerset dig deeper, they become increasingly obsessed with catching John Doe. They discover that the killer is highly intelligent and seems to be always one step ahead of them.
In the climax of the movie, Mills and Somerset track down John Doe to his apartment, where they find Tracy's head in a box. Enraged, Mills shoots John Doe, but not before the killer reveals that his plan was to make Mills commit the sin of wrath.
As the investigation unfolds, the detectives discover that John Doe is using the seven deadly sins (greed, gluttony, sloth, pride, lust, envy, and wrath) as a motif for his murders. Each victim represents one of the sins, and the killer leaves behind a cryptic message and a severed finger with a note that reads "Next" - indicating that there are more victims to come.
The movie ends with Mills, devastated and traumatized, standing in the rain, holding a gun and crying out in despair. Somerset, who had been planning to retire, decides to stay on the force to help Mills through his trauma.