In the small fishing town of Nightmute, Alaska, 17-year-old Kay Connell is found murdered. Los Angeles Police Department (LAPD) detectives Will Dormer and Hap Eckhart are sent to assist the local police with their investigation, at the request of police chief Nyback, an old colleague of Dormer's. Ellie Burr, a young local detective who is also a fan of Dormer's investigative work, picks them up when they arrive. Back in Los Angeles, Internal Affairs is investigating one of Dormer's past cases. Flying to Alaska, Eckhart reveals that he is going to testify against Dormer in exchange for immunity, to which Dormer responds that many criminals whom he helped to convict using questionable evidence could go free if their cases are reopened.
Dormer attracts the murderer to the scene of the crime, but the suspect flees into the fog, shooting one of the police officers through the leg. Dormer spots a figure in the fog and fires with his backup weapon. Rushing to the fallen figure, Dormer picks up a .38 pistol the suspect has dropped. He then discovers that he has shot and killed Eckhart. Because of Eckhart's pending testimony, Dormer knows that Internal Affairs will never believe the shooting was an accident, so he claims that Eckhart was shot by the suspect. He does not mention he has the .38 pistol. Burr is put in charge of the shooting investigation, and her team finds the .38 caliber bullet that hit the officer. That night, Dormer walks to an alley and fires the .38 pistol into an animal carcass, then retrieves and cleans the bullet. At the morgue, the staffer hands him the bagged bullet retrieved from Eckhart's body, but she is unfamiliar with its type. Dormer leaves and switches the .38 bullet for the 9 mm slug from Eckhart's body.
Over the next few days, Dormer is plagued by insomnia, brought on by his guilt over killing Eckhart and exacerbated by the perpetual daylight. Dormer starts receiving anonymous phone calls from the killer, who claims to have witnessed Dormer kill his partner. When the police learn that Kay was a fan of local crime writer Walter Finch, Dormer breaks into Finch's apartment in the nearby village of Umkumiut. Finch arrives home, realizes the police are present, and evades Dormer after a chase. Dormer returns to Finch's apartment and plants the .38 to frame Finch.
Finch contacts Dormer and arranges a meeting on a ferry. Finch wants help in shifting suspicion to Kay's abusive boyfriend Randy Stetz and will stay silent about the Eckhart shooting in return. Dormer gives advice on handling police questioning. After Finch leaves Dormer on the ferry, he shows the detective a tape recorder he used to record the conversation.
Finch calls Dormer and tells him that Kay's death was "an accident" – he beat her to death in a fit of rage after she rejected his sexual advances. The next day, Finch gives false testimony at the police station. When Finch claims Randy has a gun, Dormer realizes Finch has discovered his plant, and has hidden it at Randy's home. Randy is arrested when the gun is found at his house. Finch asks Burr to come to his lake house the next day, to collect letters indicating that Randy abused Kay.
Burr returns to the scene of Eckhart's death and finds a 9 mm shell casing, which conflicts with the bullet type from Eckhart's body. She reads her own case study from an investigation Dormer was involved in and learns he has carried a 9 mm, leading her to suspect that he shot Eckhart. Meanwhile, on his last night staying in the hotel; Dormer confides in the hotel owner, Rachel Clement, about the Internal Affairs investigation: he fabricated evidence to help convict a pedophile he was certain was guilty of murdering a child, and who would have walked if Eckhart had testified.
Dormer learns that Burr has gone to Finch's. He finds Kay's letters in Finch's apartment and realizes that Finch intends to kill Burr. He learns of Finch's lake house and rushes there. At the house, Finch knocks Burr unconscious just as Dormer arrives, and takes Burr's gun. Dormer is too disoriented from lack of sleep to fight off Finch. Burr revives and saves Dormer, while Finch escapes. Burr reveals she knows Dormer shot Eckhart, and he admits that he is no longer certain if it was an accident. From his shed, Finch shoots at them with a shotgun, and Burr returns fire with Dormer's gun while Dormer sneaks around to Finch's location. After a scuffle in which Dormer grabs Finch's shotgun, Finch shoots Dormer with Burr's gun, and Dormer shoots and kills Finch with the shotgun. Burr rushes to the fatally wounded Dormer and comforts him by affirming that Eckhart's shooting was accidental, then moves to throw away the 9 mm shell casing to preserve Dormer's reputation. Dormer stops her, however, advising her not to lose her integrity before he dies.