John is meeting with his therapist Ella for the first time in 18 months. He asks if she keeps up on the news and, if she does, then she must know why he’s there. Ella invites him to talk about what happened, telling him that he needs to get it out, and he tells her that his best friend, Sherlock Holmes, is dead.
Three Months Earlier
An art gallery is hosting a display of The Falls of Reichenbach
, recovered by Sherlock. Sherlock and John are there and the gallery director presents Sherlock with a token of their gratitude. Even though Sherlock has deduced their diamond cufflinks and he uses buttons, John tells his friend to say thank you and Sherlock reluctantly does. The newspapers continue to feature Sherlock as he solves case after case, and even Lestrade is forced to acknowledge his help... and give him the infamous deerstalker hat, to the amusement of the press.
Back at Baker Street, Sherlock expresses his displeasure at being a newspaper darling and tries to figure out how a deerstalker works, while John is less than thrilled to be described as a “confirmed bachelor.” He warns that the press will soon turn on Sherlock like they turn on others, and Sherlock tries to figure out why John is so worried about what people say about Sherlock. John just tells him to keep a low profile and find a small case to solve.
At the Tower of London at 11 a.m., Moriarty is posing as a tourist and taking photos of the halls leading to the Crown Jewels. He then texts Sherlock, who is ignoring his calls while investigating an old case. Moriarty goes through the metal detector, which lights up. He passes through his MP player and continues on, goes up to the Crown Jewels, and puts in his earphones. Moriarty then raises his arms in a conducting motion and listens to the music, while the unsuspecting security guards watch on the monitors.
At the Bank of England and Pentonville Prison, the staff goes about their business. Moriarty activates a computer key code on his player and the security monitors go out. The security guards usher everyone out but Moriarty knocks out the guard who comes for him while the other guards seal the area with Moriarty inside.
At Scotland Yard, Sgt. Donovan tells Lestrade that there’s been a break-in and they’re on it.
Moriarty triggers a computer key code for the Bank of England. The vault opens as the bank director stares at the monitors in surprise.
Lestrade and Donovan are en route to the Tower of London when they get word of the break in at the Bank of London.
Moriarty writes “Get Sherlock” on the case containing the Crown Jewels and then sends another computer key code to Pentonville Prison. The alarms go off there and Lestrade and Donovan arrive at the Tower with a squad of men. Meanwhile, Moriarty sticks a small diamond to the glass case and then shatters the glass with a fire extinguisher. When Lestrade and his men burst in, they find Moriarty sitting in the case, wearing the Crown Jewels and casually waiting for them.
John finally checks Sherlock’s phone when another text message comes in. He hands it to Sherlock and tells him that “he” is back. The message is from Moriarty, inviting Sherlock to come and play. The partners go to the Tower and check the security monitors, confirming that Moriarty used a diamond to shatter the glass. The recording also clearly shows Moriarty’s message to get Sherlock.
Moriarty is quickly put on trial and Sherlock is called as a witness. He and John leave their apartment where the press is gathered outside. Meanwhile, Moriarty is taken to the dock and he asks a female clerk to slip her hand into his pocket. Her superior agrees and she gives him the piece of gum that she finds.
Sherlock is washing his hands in the restroom when a woman wearing a deerstalker hat comes in and recognizes him. He realizes that she’s a Sherlock fan and she asks him to sign her chest. However, Sherlock quickly confirms that she’s a journalist and is deliberately testing him. The woman introduces herself as Kitty Riley but Sherlock refuses to give an interview no matter how much money she offers him. Kitty threatens to publish explicit rumors about Sherlock and John if he doesn’t cooperate and advises him that he’ll need someone on his side eventually. She assures Sherlock that he can trust her, and he invites her to read him to see everything she needs for an interview. When Kitty says nothing, Sherlock analyzes her and says that she’s desperate and hungry, not smart. He takes her recorder and says, “You repel me,” and then walks away.
In court, the prosecuting barrister leads Sherlock through the case, having him testify on Moriarty’s character. Sherlock provides the barrister with advice and warns that Moriarty is the spider at the center of a vast criminal web. When the judge disputes his expertise, saying it’s up to the jury to decide, Sherlock analyzes each of the jury members to display his expertise. The judge tells him to stop showing off or be cited with contempt, but Sherlock soon ends up in a cell.
John gets him released and his friend points out that Moriarty isn’t mounting a defense. They go back to their apartment and Sherlock figures that Moriarty is in a cell because he wants to be there.
The next day, the defense barrister refuses to call any witnesses even though he’s entered a plea of not guilty. Smiling, Moriarty glances up at John in the chambers. The judge summons up the case for the jury and recommends that they find him guilty. The jury comes back after six minutes with a verdict of not guilty. John calls Sherlock with the news and warns him that Moriarty will be coming after him.
Sherlock hangs up and sets tea, and then starts playing the violin. Moriarty comes in without knocking and Sherlock invites him to have tea. The criminal mastermind figures that Sherlock is pleased that he’s back on the streets because he needs a suitable opponent, and that all fairy tales need a good old-fashioned villain. Moriarty cheerfully explains that he threatened all 12 jurors and forced them to return the not guilty verdict. Sherlock wonders how he plans to burn him, and Moriarty admits that it’s the final problems and asks his rival if he’s worked it out. As he finishes his knee, Moriarty taps on his knee.
Moriarty asks Sherlock to prove that he knows why he broke into three places and didn’t steal anything, and Sherlock explains that Moriarty doesn’t need anything because he has the computer key code that got him into all three. Moriarty explains that his computer key code can open any door and the trial was an advertisement. Now rogue governments and terrorists all want his computer key code. Sherlock wonders what he really wants and Moriarty tells him that he wants to solve the final problem, their problem. He warns Sherlock that the fall will start soon and that he owes him, and then leaves.
Two Months Later
John withdraws money from an ATM and receives a message that there’s a problem with his card. The machine message has his name on it and a car pulls up behind him. He’s taken to the Diogenes Club and tries to ask the club members where he can find Mycroft. They refuse to answer and summon the staff, who gag John and escort him to Mycroft. Mycroft explains that total silence at the club is traditional and then shows John a tabloid newspaper. Kitty has written an article promising an expose on Sherlock based on information provided by an actor, Richard Brook.
Mycroft then shows John photos of a man that the latter doesn’t recognize, and explains that he’s an expert assassin that has moved in near 221B Baker Street. A total of four international assassins have moved into the neighboring flats and suspects that it’s Moriarty. John points out that if it were Moriarty, they’d already be dead, leaving them to wonder who is responsible. When John suggests that Mycroft talk to Sherlock, Mycroft says that there’s too much history between them. As John leaves, Mycroft says that they both know that Moriarty will attempt to destroy Sherlock, and asks John to look after him because Sherlock won’t accept Mycroft’s help. John considers it and then walks away without a word.
When John returns home, he finds a sealed and unmarked envelope on the doorstep. There’s nothing inside but bread crumbs. A workman brushes past him and John goes up to the apartment, where Lestrade and Donovan are meeting with Holmes. Claudia and Max Bruhl, the children of the U.S. Ambassador, have been kidnapped from the boarding school where they were staying. The ambassador has asked for the “Reichenbach Hero” personally.
Sherlock and John accompany the police to the school and talk to the headmistress, Miss MacKenzie. Despite Lestrade’s advice to take it easy, Sherlock yells at her to explain and she insists that the doors and windows were locked and no one could have gotten in. He tells her that he believes her and that he just yelled at her to get her to speak quickly. Sherlock then goes to Claudia’s room and looks around. He finds an envelope like the one John found earlier, containing a book of Grimm’s fairy tales. Sherlock then examine the door to Max’s room and realizes that the boy would have seen an intruder’s silhouette through the pebbled glass window. He concludes that Max, a fan of spy books, would have left a sign, and then smells linseed from his cricket bat.
Sherlock has Anderson produce an ultraviolet light which reveals the words “help us” written on the wall in linseed oil. More importantly, the boy covered his soles with the same oil, leaving a trail for them to follow down the hall. The kidnapper pushed Max in front of him, trailing through the oil himself. As Sherlock takes samples of the oil, John points out that he’s smiling despite the fact they’re dealing with kidnapped children.
As they return to London, Sherlock explains that the kidnapper slipped in with the parents and staff as the other children left at the end of the term. Once inside, he hid until the time was right. Sherlock and John go to St. Bartholomew’s and tell Molly that they’re having lunch with them: packets of crisp. When Sherlock explains that they’re after Moriarty and need Molly to tell them everything she knows about her ex-boyfriend when he was impersonating an IT worker, Molly insists that she knows very little about him.
Sherlock uses the lab equipment to examine the oil samples, since they contain all the other trace elements on the kidnapper’s shoes. He finds traces of chalk, asphalt, brick dust, vegetation, and an unidentified glycerol molecule. When Sherlock mutters “I owe you,” Molly overhears him and asks what he means. He dodges the question and Molly says that her father typically put on a brave face but she could tell when it slipped. She asks if Sherlock is okay and offers anything he needs. Sherlock doesn’t understand what he could need from her, and Molly quickly walks away.
John goes over the photos of the crime scene and notices that the envelope with Claudia’s book looks like the one he found on the doorstep. Sherlock examines the bread crumbs and realizes that it relates to the tale in Claudia’s book of “Hansel and Gretel.” He also remembers Moriarty talking about fairy tales and realizes that the glycerol molecule is PGPR, which is used in making chocolate.
In an abandoned sweets factory, Max and Claudia are desperately eating chocolate.
Lestrade tells Sherlock that they’ve received a fax saying that the children are dying. Sherlock gives the list of five elements to Lestrade and says they need to find where all five can be located. They go over the elements and Sherlock coordinates with his homeless network. He finally locates a factory in Addlestone and the police go there. Sherlock accompanies them and finds a candle that was just blown out and empty sweets wrappers. He confirms that the wrappers were painted with mercury, but not enough to kill them on its own. However, the hungrier the children were, the more they would eat and the faster they would die. Donovan finds the children and they get them to the hospital.
Once Lestrade and Donovan finish questioning the children, Sherlock goes in. As soon as she sees him, Claudia starts screaming and Lestrade gets him out. They assume that she’s traumatized and Max is still unconscious and unable to provide anything helpful. Sherlock remembers Moriarty’s threat and starts to walk out, and Donovan comments that it was unbelievable how he managed to track the children down from a footprint. Outside, Sherlock catches a cab and tells John to take the next one because he’s thinking.
Back in Scotland Yard, Donovan considers all the evidence and Lestrade asks if there’s a problem.
In the taxi, the private TV comes on and Moriarty’s face appears on it. He tells Sherlock about the story of Sir Boast-A-Lot.
Donovan points out to Lestrade that Sherlock did it all from a single footprint. When he says that Sherlock is a genius, she says that’s one explanation. Donovan suggests that Sherlock himself is the kidnapper and Anderson agree with her.
Moriarty tells his story of how the other knights didn’t believe Sir Boast-A-Lot’s stories, but that wasn’t his final problem and then signs off. Sherlock orders the cab driver to pull over at Baker Street and confronts the driver, Moriarty. He drives off before Sherlock can stop him, and a pedestrian pulls Sherlock out of the way of an approaching car. Sherlock shakes his hand in thanks and two shots ring out. The pedestrian drops to the ground, dead, as John pulls up in his taxi.
As the EMTs take the dead man away, John explains that the pedestrian was one of the assassins that Mycroft had identified. Sherlock realizes that the other assassins killed the man because they figured Sherlock has something that they all want, and will kill each other if they try to get it from him. Sherlock notices the dust and calls Mrs. Hudson to ask her where she’s dusted. He looks for a broken dust line and finally locates a hidden camera.
Lestrade comes in and Sherlock already knows that he’s there to bringing him in for questioning. He figures that Moriarty planted the doubt in Donovan’s mind, and now he’ll use the hidden camera to get a photo of Sherlock being arrested. Sherlock says that he won’t play long and examines the camera, while Lestrade goes downstairs to where Donovan is waiting. John watches them go and Sherlock tells them that they’ll decide whether to get a warrant and come back to arrest him. Sherlock insists that he doesn’t care what the world thinks about him, and John says that he doesn’t want people thinking that his friend is a fraud. When he hesitates, Sherlock realizes that John is worried that they’re right about him and angrily insists that Moriarty is playing them all. John denies it, pointing out that even Sherlock couldn’t fake being annoying all the time.
Lestrade, Donovan, and Anderson go to the superintendent, who is surprised to learn that they’ve brought him in on dozens of cases. The superintendent angrily tells Lestrade to bring Sherlock in immediately. As they leave, Lestrade secretly calls John to warn him. Mrs. Hudson comes in with another envelope, delivered by a man with a German name like one in a fairy tale. Inside the envelope is a butter crisp gingerbread man. The police arrive, handcuff Sherlock, and take him away. Donovan points out that she warned him from the beginning that Sherlock would become a criminal. The superintendent arrives and dismisses Sherlock as a weirdo, and John punches him in the face.
John is taken down with Sherlock, who realizes that they have to escape even though they’re handcuffed to each other. He grabs a radio mike and generates feedback to deafen the arresting offices. Sherlock then grabs a gun and orders everyone down, and then takes John as a “hostage.”
The two men run for it, discarding the gun, and John suggests they go to Mycroft for help. Sherlock doesn’t advise a reconciliation attempt at the moment, and then notices one of the assassins following them. Determined to get answers, Sherlock steps in front of an oncoming bus. The assassin has no choice but to rescue them, and Sherlock grabs his gun and demands to know what the killer wants. He explains that they all believe that Moriarty left the computer key code in their flat. Sherlock concludes that Moriarty planted the key code when he visited him two months ago. A hidden assassin kills their captive to eliminate the competition, while Sherlock ducks into an alleyway and explains to John about the computer key code. The message that Moriarty left, “Get Sherlock,” was a message to the terrorists and rogue governments telling them where they could find the code.
As they try to figure out what to do, John notices the newspaper article Mycroft had earlier and reads it more carefully. Kitty claims that Sherlock hired an out-of-work actor and supposed “close friend,” Richard Brook, and John asks who Richard Brook is.
Kitty comes home and finds Sherlock and John, still handcuffed together, waiting for her. She points out that she wanted to be on his side and doesn’t know who Brook is, but Sherlock doesn’t believe her. Before she can answer, Moriarty comes in and cowers before them. Kitty explains that there was never a Moriarty, and that Brook is an actor that Sherlock hired to play Moriarty. John angrily tells Moriarty that he tried to blow him up, but Moriarty claims that Sherlock paid him to stage the entire thing. Kitty has what she considers exclusive proof that Sherlock invented Moriarty and all of the crimes, and promised that he would be found not guilty at the trial. John doesn’t believe it but Moriarty has a resume showing that he’s a storyteller on a children’s program. Moriarty runs out before Sherlock can grab him, and the two men go after him. As Sherlock leaves, Kitty tells him that he repels her.
Outside, Sherlock warns his friend that Moriarty has created a big enough lie, and spread enough doubt, that he’ll be believed. He realizes that Moriarty only needs to do one more thing and then tells John that there’s something he has to do on his own and walks off.
Molly is closing up at the hospital and finds Sherlock waiting for her. He tells her that he’s always trusted her and that he’s not okay. When Molly asks what he needs, Sherlock wonders if she would help him if he wasn’t what either one of them thought he was. She simply repeats her question and Sherlock says that he needs her.
Mycroft arrives at the Diogenes Club and finds John waiting for him. John points out that Kitty has done her homework and only someone close to Sherlock could have given her the information. He realizes that Mycroft came to him for help because he made a mistake with Moriarty, and Mycroft explains that they watch people like Moriarty, and Moriarty had the key code. They abducted him and interrogated him for weeks but he didn’t give the code up. The only time Moriarty would talk is when Mycroft would come in, but Mycroft had to offer facts on Sherlock in return. John points out that Mycroft has given Moriarty the perfect ammunition to destroy Sherlock: small facts to support his big lie. As John leaves, Mycroft says that he’s sorry and asks John to tell Sherlock.
Sherlock calls John to the hospital and tells him that they can use the key code to destroy Moriarty’s false identity. He tries to work out where Moriarty hid it, and John taps his fingers while considering the matter. Sherlock notices and remembers Moriarty tapping his fingers during his visit. He then sends a text message to Moriarty telling him to meet him at the top of the hospital, and that he has something of Moriarty’s.
The two men wait and John dozes off. When his phone goes off, he takes the call from paramedics, who say that Mrs. Hudson has been shot. John tells Sherlock, who tells him to go without him because he has to think. Furious, John calls him a machine and says that it’s friends that protect each other, and then storms off. Moriarty sends a text message saying that he’s waiting.
Sherlock goes to the roof and finds Moriarty waiting for him. He explains that he has spent his life looking for distractions, but even Sherlock failed him in the end. Sherlock knows that “Richard Brook” is “Reichenbach” in English, the case that made Sherlock’s name. Moriarty notices that Sherlock is tapping his fingers and congratulates him on getting that as well. He had typed out the key code in binary code, and all of the assassins tried to keep him alive because Sherlock memorized the pattern. When Sherlock threatens to alter the records and bring back Jim Moriarty, Moriarty complains that it’s too easy and tells him that there is no key. The rhythm is from Bach, and Moriarty pulled off the three events with inside help.
Moriarty tells Sherlock that his one weakness is that he expects things to be clever, and says that it’s a good thing he chose a tall building. Sherlock realizes that his final act will be suicide now that his life is in ruins.
John arrives at Baker Street and goes inside. Mrs. Hudson is fine and standing with the workman who came in earlier when John received the envelope. He goes back outside to hail a taxi.
Sherlock tells Moriarty that he can still prove that he created a false identity, but Moriarty tells him that it would be much less effort to kill himself. After a moment Sherlock grabs him and says that he’s insane. Moriarty warns him that if he doesn’t kill himself, then his friends will die. Three gunmen are targeting John, Mrs. Hudson, and Lestrade even as they speak. They will only stop if Moriarty’s people see Sherlock jump and signal the killers. Moriarty tells him that no matter what Sherlock does to him, his only three friends in the world will die.
Sherlock steps to the edge of the roof and asks for a moment of privacy. Moriarty steps away, and Sherlock first smiles and then laughs. Moriarty hears him and demands to know what he missed, and Sherlock steps onto the roof and says that there must be a recall code. He figures that he can make Moriarty give up the code, and says that Moriarty knows it as well. Moriarty says that there’s nothing Sherlock can do to give it, up and Sherlock says that he’ll do anything that it takes. He points out that he may be on the side of the angels, but he isn’t an angel. Moriarty smiles and concedes that Sherlock is not ordinary, and is just like him. He thanks Sherlock and shakes his hand, and admits that as long as he’s alive, Sherlock has a way to save his friends. Moriarty then takes out a gun and shoots himself in the head, killing himself.
Each of the killers, including the worker at Baker Street, prepares to kill their designated victims.
With time running out for his friends, Sherlock steps onto the edge of the roof and watches as John gets out of the taxi after it pulls up to the hospital. Sherlock calls John and begs him to go back. When John keeps going, Sherlock tells him to stop and look up. He then lies and says that everything is true and he invented Moriarty and that he’s a fake. When John points out that no one could have known what Sherlock did about his sister when they first met, Sherlock says that he researched him. Crying, Sherlock tells John to stay where he is and watch him no matter what, and then drops the phone and steps off the ledge.
John runs to his friend but a passing bicyclist knocks him over. A crowd gathers around Sherlock’s body and a dazed John staggers through, insisting that he’s a doctor. He checks Sherlock’s pulse and finds nothing, and EMTs rush in to move the body away. As John watches leaves, the sniper puts his gun away.
Later, Mycroft is at the club reading the tabloid story on his brother’s death.
John sits at home, alone.
Ella asks John what he wanted to say that he didn’t.
Later, John and Mrs. Hudson go to the cemetery. As they stand at Sherlock’s grave, John says that he can’t go back yet and admits that he’s angry. Mrs. Hudson understands and crying, leaves John alone. He tells Sherlock that he was the most human being that he knew, and asks him to be one more miracle: live. Crying, John turns and strides away... unaware that Sherlock is watching from the trees.