In 1891, London detective Sherlock Holmes (Robert Downey, Jr.) and his partner and flatmate Dr. John Watson (Jude Law) race to prevent the ritual murder of a woman by Lord Henry Blackwood (Mark Strong), who has killed five other young women similarly. They stop the murder before Inspector Lestrade (Eddie Marsan) and the police arrive to arrest Blackwood.

Three months later, Holmes' eccentric behavior again annoys Watson. While he enjoys their adventures together, Watson looks forward to marrying Mary Morstan (Kelly Reilly) and leaving 221B Baker Street. Meanwhile, Blackwood has been sentenced to death and requests to see Holmes, where he warns of three more unstoppable deaths that will cause great changes to the world. Blackwood is subsequently hanged and pronounced dead by Watson. Three days later, Holmes is visited by Irene Adler (Rachel McAdams), a professional thief and his former adversary, who asks him to find a missing man named Luke Reordan. After her departure, Holmes follows her as she meets with her secret employer, hidden in the shadows of a carriage. The concealed man states that Reordan is the key to Blackwood's plans. Holmes only learns that the man is a professor and that he intimidates Adler.

Blackwood's tomb is destroyed from the inside out, Reordan is found dead inside the coffin, and sightings of a living dead Blackwood, which has left a gravedigger in shock, cause public panic. Following a series of clues from the body, Holmes and Watson find Reordan's home and discover experiments attempting to merge science with magic. After they survive a battle with Blackwood's men, Holmes is taken to the Temple of the Four Orders, a secret magical fraternity with considerable political influence. The leaders – Lord Chief Justice Sir Thomas Rotheram (James Fox), U.S. Ambassador Standish (William Hope), and Home Secretary Lord Coward (Hans Matheson) – ask Holmes to stop Blackwood, a former member of the society and, as Holmes deduces from physical similarities, Sir Thomas's son. Sir Thomas and Ambassador Standish are later killed through apparently supernatural means by Blackwood, allowing him to control the Order. He plans to overthrow the British government, then conquer the United States and the world. He lures Holmes to a warehouse where he finds Adler, chained to a hook, gagged, and heading towards a bandsaw, though he saves her in time. However, Watson is injured in a series of explosions set up by Blackwood. Lord Coward, who has been in league with Blackwood all along, issues an arrest warrant for Holmes.

A black and white photograph of the Tower Bridge during its construction.
The finale is on the unfinished Tower Bridge.
Holmes goes into hiding and studies Blackwood's rituals, concluding that the next target is Parliament. Holmes tricks Coward into revealing that the plan is to kill its members. He, Adler and Watson discover a machine below the Palace of Westminster, based on Reordan's experiments, designed to release cyanide gas into the Parliament chambers, killing everyone but Blackwood and his supporters, to whom Blackwood slipped the antidote. Blackwood walks into Parliament and announces that soon all but his supporters will die. As Holmes and Watson battle Blackwood's men, Adler removes the cyanide containers from the machine and flees, pursued by Holmes. Blackwood and Coward realize their plan has failed; Coward is captured but Blackwood escapes. Holmes confronts Adler on top of the incomplete Tower Bridge, but is interrupted by Blackwood. As Holmes and Blackwood fight, Holmes tricks him into becoming entangled in the ropes and chains hanging over the Thames, while Holmes explains the technical trickery behind Blackwood's supposed magic. After a climactic fight, Blackwood, with a noose of chains around his neck, falls from the bridge and is hanged.

Adler explains that her employer is Professor Moriarty, warning that Moriarty is as intelligent as Holmes but far more devious. As Watson moves out of 221B, the police report to him and Holmes that a dead officer was found near Blackwood's device. Moriarty used the confrontations with Adler and Blackwood as a diversion while he took a key component, based on the new science of radio, from the machine. Holmes looks forward to the new case and new adversary.