In a run-down neighborhood in Dorchester, Boston, three-year-old Amanda McCready has been abducted along with her favorite doll, Mirabelle. P.I. Patrick Kenzie (Casey Affleck) and his partner and girlfriend Angie Gennaro (Michelle Monaghan) witness a televised plea for Amanda’s return by her mother, Helene (Amy Ryan), amid a media frenzy. The girl’s aunt Bea hires them to find Amanda.
Using his connections in the Boston crime underground, Patrick discovers that Helene and her boyfriend “Skinny Ray” were drug mules for a local Haitian drug lord named Cheese, and had recently stolen $130,000 from him. After discovering Ray has been murdered by Cheese’s men, Patrick and Angie join police detectives Remy Bressant (Ed Harris) and Nick Poole in investigating the case. They believe that Cheese may have taken Amanda.
Patrick meets with Cheese and tries to negotiate the return of Cheese’s stolen money in exchange for Amanda, but Cheese initially denies any involvement in the girl’s disappearance. Police Captain Jack Doyle (Morgan Freeman) later reads Patrick a telephone transcript of Cheese calling into the station to set up an exchange for Amanda. The exchange at a nearby quarry is botched after a gunfight breaks out, killing Cheese. It is believed that Amanda fell in the quarry’s pond and drowned; her doll is retrieved from the water and returned to Helene. Doyle, whose own daughter was killed years before, takes responsibility for the death and goes into early retirement following public outcry over the mishap.
Two months later, a seven-year-old boy is abducted in Everett, and Patrick receives information that he was taken by Corwin Earle, a known child molester. After entering the suspect’s house and finding evidence of the abducted boy, Patrick returns with Remy and Nick late at night to rescue him. A shootout ensues and Nick is fatally wounded. Patrick enters the house and finds the boy’s dead body, then shoots the surrendering Corwin in the back of the head in a fit of rage. Trying to alleviate Patrick’s guilt, Remy confides that he once planted evidence on someone with the help of “Skinny Ray”. Patrick later remembers that Remy had told him he didn’t know Ray.
Nick dies of his injuries. After his funeral, Patrick speaks to a police officer named Devin who tells him that Remy had known about Cheese’s stolen money before Cheese knew it was missing. Patrick questions Bea’s husband Lionel in a bar and pieces together that Lionel and Remy had conspired to stage a fake kidnapping in order to take the drug money for themselves and to teach Helene a lesson. At that point, Remy (trying to cover for his earlier mistake) enters the bar wearing a latex mask and holding a shotgun, staging a robbery to interrupt the conversation. Patrick realizes that Remy plans to kill him and Lionel to keep them quiet, but the bartender shoots Remy twice in the back. Remy flees and is pursued by Patrick to the rooftop of a nearby building, where he dies from his wounds.
Patrick is questioned by the police about Remy’s death and learns that the police never had a phone transcript like the one that Doyle had read to him prior to the botched exchange. Patrick and Angie then drive to Doyle’s home, where they find Amanda alive and well. Doyle was part of the kidnapping all along and helped set up the fake exchange to frame Cheese and throw Patrick off the scent. Patrick threatens to call the authorities but Doyle tries to convince him that Amanda is better off living with him than with her neglectful, cocaine-using mother.
Patrick leaves and discusses the choice with Angie; she believes Amanda is happy and safe with Doyle, and says she will hate Patrick if he returns Amanda to her mother. Patrick decides to call the police to collect Amanda, as he believes she belongs with her mother. Doyle and Lionel are arrested, Amanda is returned to her mother with heightened publicity, and Patrick and Angie break up.
Patrick later visits Amanda as Helene is about to leave for a date, not yet knowing who would babysit, and he volunteers to watch the girl. Patrick asks Amanda about the doll Mirabelle, only to have Amanda inform him that her doll’s name is Annabelle, implying that Helene did not know the name of her daughter’s favorite toy.