A panicked woman gathers a few things, one of them a loaded gun, as she sidesteps the dead body on her apartment floor. The police are at the front door. The woman flees down the fire escape as the cops burst inside. They are hot on her trail. The woman ducks into a nearby dental office. She locks the door behind her. There are several people inside. They have just become this frantic woman's hostages. The police want to negotiate, but the woman will only talk to one person: Richard Castle.
Our favorite mystery writer is sound asleep in his bed when he gets a call from Captain Gates. Okay, he's not quite asleep. He's "trying" to sleep as Beckett fidgets beside him trying to figure out what to do now that she's been fired from the Justice Department. Castle gets a big slice of morning Pi when Alexis's main man pops in to borrow one of his razors. Martha also swings by with some morning coffee and news that her stage combat class will be taking place in the living room soon. It's at this point when Alexis mentions the call from Gates. Beckett joins Castle at the crime scene though only as an observer thanks to a city-wide hiring freeze.
The hostage-taker is Emma Riggs. She quizzes Castle about several of his stories to make sure he's the real deal. If there's one thing Castle knows, it is Richard Castle trivia. Emma doesn't trust the cops. She wants Castle to come inside. He agrees to do so only if Emma releases a little girl and her mother. Castle gets a code word from the cops he's to say if he needs backup. It's "cheeseburgers." Why? Well, Castle loves a good cheeseburger. Emma vows that she didn't kill her boyfriend. She wants Castle to prove her innocence. Emma is Castle's number one fan. If anyone can help her, it's him.
Emma tells Castle that she thought her boyfriend, Angelo Vazquez, was going to propose to her as a birthday surprise. She woke up in the morning to find him dead. She had some scotch the night before and had no plans for her boyfriend to come over that night. Outside, Beckett gets permission from Captain Gates to work the crime scene. Ryan and Esposito show her text messages where Emma accuses Angelo of having an affair. There's a written note suggesting the guy was traveling to Scarsdale to perhaps meet his secret lady. The initials "S.H." are also seen on the paper. It's discovered that Emma is on antipsychotic meds.
Castle needs Emma to be honest with him. She can't explain the texts on her phone. Castle finds inconsistencies in her past messages. He takes Emma's phone out to the police so they can dust it for prints. There's a chance Emma is telling the truth. There's also a chance that one of the hostages, a hotheaded patient named Mickey, may take matters into his own hands. Gates lets Castle work with Beckett and Sully to prove his theory about Emma. They learn that the victim was, indeed, in Scarsdale. He wasn't having an affair, but may have been planning a robbery.
Emma swears Angelo put his minor crimes past behind him years ago. She points her gun at Castle once she realizes he knows about her juvenile record. She did time for killing her foster brother when she was a kid in the same way Angelo was found stabbed to death. Emma maintains her innocence. She claims the death of her foster brother was a result of the victim and his twin trying to attack her. The surviving brother lied and placed the blame on her. Emma was saved by the Sisters of St. Helena's Home for Children. St. Helena's is the "S.H." in the note Angelo had.
Angelo broke into St. Helena's to get the name of his girlfriend's birth parents for her. Emma lets her guard down once she realizes this. Mickey takes this opportunity to lunge at her. BANG! Emma's gun goes off. Castle is hit! He crashes backwards. The cops storm the place. Beckett sees that Castle is down. She rushes to his side. He's unconscious, but awakens suddenly yelling "cheeseburgers!" Fortunately, he was wearing his bulletproof "Writer" vest. The bullet nailed him in the "I." Castle is okay. He also knows who the killer is.
Castle believes Angelo's murder has something to do with the stolen adoption papers suggesting that one of Emma's birth parents is the killer. Beckett orders Esposito to search the victim's place. It's almost as if she still works there. Meanwhile, Ryan questions the lawyer who paid to get illegal access to Emma's sealed juvenile records. The smarmy attorney, Vance, denies he swiped the file. Another lead steers the team toward a prominent real estate developer named Aaron Stokes who lives in Scarsdale. He's Emma's birth father.
Stokes lets Beckett know that he always regretted not trying to find Emma. He also happens to be the father-in-law of the smarmy attorney, Vance. The guy was staying at his father-in-law's place when Angelo dropped the news about Mr. Stokes's long lost daughter. He killed the guy and framed Emma so there would be no chance of anyone taking a cut of his wife's inheritance. He never found the adoption records he was looking for because they were in a wrapped gift box that was to be Emma's present. Case closed.
After Vance confesses to the murder, Castle lets Emma know that someone wants to see her. Emma hugs her father for the first time ever. Later, Stokes assures Captain Gates that he'll be there for his daughter from here on out. He's shocked to learn that Beckett isn't a detective because of the city's money issues. One call from Stokes to the police commissioner changes all that. Beckett is back! That means Castle is back, too! Of course, they need to keep things professional in the workplace. Fortunately, Beckett doesn't officially start work right away. So Castle plants a nice kiss on her smack-dab in the middle of the squad room.