The story begins with the narrator, Doctor John Watson, explaining that his friend Sherlock Holmes always refers to Irene Adler as "THE woman,” because he believes she is the best woman he has ever met in every regard. Watson declares that Sherlock Holmes is too analytical to ever feel romantic love for someone because that would invite distractions that could disrupt his thinking about cases. Watson explains that he hasn't seen much of Holmes because he's gotten married and moved into a new home with his wife, leaving Holmes to live alone in the home the two men used to share. Now that he lives with his wife, Watson tracks Holmes by reading about his cases in the newspaper. One night when he is walking home from a patient's house, Watson finds himself in front of Holmes's apartment on Baker Street. He looks through the window and sees Holmes pacing, which he recognizes as a sign that Holmes is thinking excitedly about a case. Watson decides to ring the bell for a visit.

Holmes directs Watson to a chair and provides him with a drink and cigars. He tells Watson that he thinks Watson has gained several pounds since getting married. Holmes begins guessing things about Watson's new life based on the clues in his appearance. Watson is impressed. Holmes then explains each detail he noticed and how it led him to the conclusions he drew about Watson. Holmes shows Watson a letter he received explaining that a gentleman would arrive at 7:45 that night to discuss a case. The gentleman has heard from several sources that Holmes is the best and most discreet private investigator. The letter also says the man may be wearing a mask. Watson and Holmes discuss who the man may be, using clues from the letter to draw their conclusions. Holmes figures out that the paper the letter was written on was made in Bohemia and the person who wrote the letter was German. A horse-drawn carriage pulls up to the home. Holmes and Watson deduce from the quality of the carriage that the client must be quite wealthy.

Watson attempts to leave so Holmes can be alone with the man, but Holmes insists he stay. A tall, muscular man enters the apartment dressed in flashy clothes and a mask. He asks in a German accent if Holmes has read his letter. Holmes says yes and introduces Watson. The man says he is a nobleman from Bohemia and makes Holmes and Watson swear to secrecy on the facts of the case for two years. He apologizes for the mask and explains that he is using a false identity. Holmes says he already knows everything the man is attempting to explain, and he refers to him as Your Majesty, revealing that he knows the man's true identity. The man rips off his mask to reveal that Holmes is correct. He is the King of Bohemia, Wilhelm Gottsreich Sigismond von Ormstein, and he is visiting himself, rather than sending someone in his stead, because the matter is very delicate.

The King explains that five years prior he was in a relationship with an American opera singer named Irene Adler. Holmes tells Watson to find her in his index where he keeps biographies and facts about people. The King says the woman has both letters with his royal seal and pictures of the two of them together, and that he has already tried to buy the photos, but Adler refused. He also tried to have the photos stolen multiple times, but each time he failed. The King is about to marry a princess from a well-known conservative family, and he doesn't want her to see pictures of him in a previous relationship. The King says that Adler has warned him that she will send the pictures to the bride when their marriage is made public in three days. Holmes asks the King to stay in London during the investigation. The King tells Holmes to spend as much money as he needs on the investigation, at this point presenting a bag filled with gold and cash along with Adler's address. Holmes tells Watson to come back tomorrow to talk about the case.

Watson returns to Baker Street the next day, but Holmes is not there. The landlady tells Watson that Holmes has been gone all day. Watson decides to wait, and he contemplates the fact that he has complete faith Holmes will solve the case. As he is thinking, a disheveled man who appears to be drunk enters the apartment, nods, and walks into Holmes's room. Watson must look three times before believing that the man is Holmes in disguise. Minutes later, Holmes comes out of the room dressed in his normal suit and laughs to himself. He explains that he went to Irene Adler's home dressed as a groom, a person who cares for horses. He visited her stables and talked to the other grooms who work there.

The workers love to gossip, so they were happy to answer Holmes's questions about Adler. They told him that a lawyer named Godfrey Norton had been coming to visit Adler every day. Moments later, Norton arrived at Adler's home. Holmes watched through the window as Norton and Adler spoke animatedly. Then Norton and Adler left in different cabs but asked to be taken to the same church. Holmes got into a cab and followed them to the church where he was asked to serve as a witness while Norton and Adler were married. Afterward, he watched as they left the church separately and went in opposite directions. 

Holmes now asks Watson if he is willing to do something against the law to help him. Watson says he doesn't mind breaking the law for a good cause. The two men discuss their plan. Holmes re-enters his bedroom and comes out a few minutes later dressed as a clergyman. Holmes goes back to Adler's house at the time she usually returns home. Several people mill about in the street, including some tough-looking men. Holmes tells Watson that since Adler is married, she is probably worried about her husband finding the pictures of her and the King. Holmes lists other facts that lead him to conclude that the picture is hidden somewhere in her home.

Watson points out that the King has sent men to search the house and they could not find the picture. Holmes vows to get Adler to reveal the location of the photograph herself. As Adler’s carriage pulls up to her home, the men in the street push past each other to open her door, hoping for a tip. Holmes jumps in as if to protect Adler and he falls to the ground. Adler runs up her front steps and then turns back to see Holmes lying bloody and injured in the street. People begin to surround him to help. She asks if the man is okay, and the people in the street say that he is fine but hurt. They point out that he was a good man for helping her and ask if he can come into her house to recuperate. Adler says yes and sees him into her living room. Watson watches Adler and Holmes through an open window from the street.

Watson lights a firecracker, throws it through the open window, and yells, "Fire!" Smoke billows from the window, causing people in the street to also yell, "Fire!" Holmes yells that it's a false alarm and then meets Watson as planned. They quickly flee the scene. Watson asks Holmes if he has the photograph. Holmes says no, but he knows where it is because he watched where Adler went when she thought her home was on fire. He saw her begin to retrieve the photograph from a secret panel. When she realized the fire was a ruse, she ran from the building. A servant watched Holmes closely, so he didn't feel comfortable taking the picture. Holmes and Watson walk home discussing their plan to return in the morning with the King to get the photo. They decide to visit the home at 8 am to surprise Adler. At the door to his office, Holmes hears someone say his name. He recognizes the voice but can't place it. Excited, Watson spends the night at Holmes's apartment, and the King arrives in the morning.

Holmes tells the King that Adler married another man, so he no longer needs to worry about her sharing the picture, but they will still retrieve it nonetheless. The three men go to Adler's home, but she’s gone. She's left a note for Holmes with a woman, who tells Holmes that Adler has left England forever with all her belongings. A shocked Holmes enters the apartment to see the furniture strewn about. He opens the envelope. It holds a picture of Adler and a letter in which she congratulates him for manipulating her into revealing the location of the photos. She had been warned about Holmes’s intelligence, but he still outsmarted her. When she realized he wasn't a clergyman, she ran from her home and sent a servant to watch Holmes. Then she changed into a disguise and followed Holmes. It was Adler who called out to Holmes at his office. The letter confirms that Adler left the country permanently. She still has her photos, but the King shouldn't worry about her sharing them because she is very much in love with her new husband. She wishes the King well with his own marriage.

All three men are amazed by Adler's cleverness, but Holmes seems most affected as he is not used to being outsmarted. Holmes apologizes for failing to get the photo, but the King says he is satisfied with the outcome because he trusts Adler’s word. The King wishes that Adler had been from a higher class so that he could have stayed with her, and Sherlock implies that it is the King who doesn’t measure up to Adler. In payment for Holmes’s work on the case, the King presents an emerald snake ring. Holmes, however, asks if he can instead take the photo of Adler that she included with the letter. The King holds out his hand for a handshake, but Holmes takes the picture and walks away. Watson concludes by summarizing that the case is notable because it prevented a political scandal in Bohemia, but more so because it introduced Holmes to Adler, a woman he could never forget.