The film opens with Jericho Stewart (Kevin Costner) standing on a beach. His voice-over states that "they" thought they knew what they were getting when they got inside his head, but they were wrong. He promises that anyone who hurts him will get hurt worse. A van pulls up behind Jericho, and a man steps out. Jericho turns to face him.
We jump to a while back in London, where CIA agent Bill Pope (Ryan Reynolds) stops in a shop to pick up a duffle bag full of money. Bill takes time to call his wife Jill (Gal Gadot) back home. The two have a daughter, Emma (Lara Decaro). Bill is being observed by his superior Quaker Wells (Gary Oldman) and fellow agents Marta Lynch (Alice Eve), Esteban Ruiza (Amaury Nolasco), and Pete Greensleeves (Scott Adkins). Bill is knowingly pursued by anarchist Xavier Heimdahl (Jordi Molla). His right-hand woman Elsa Mueller (Antje Traue) follows Bill as he hops into a cab. Elsa and other villains catch the cab and shoot the driver before capturing Bill.
Bill is taken to an abandoned building and is tortured by Heimdahl with electrical cables to give up information on Jan Strook, aka The Dutchman (Michael Pitt), a hacker that has created a wormhole that would allow Heimdahl to bypass computer codes and infiltrate central governments. Bill tells Heimdahl "fuck you", which Heimdahl respects, but also gets Bill a cable to his mouth, and he is electrocuted to death. After Heimdahl and Elsa leave, other CIA agents find Bill's body and inform Wells that he is dead.
The CIA gets in touch with Dr. Franks (Tommy Lee Jones), who has been working on a memory program that places the memories of the deceased in the head of a living specimen. The plan is to put Bill's memories in someone's head to locate Strook, as he was trying to sell his program to the CIA. They decide on using Jericho, who is known as a remorseless killer with no emotional development that resulted from a childhood incident in which Jericho states that his father threw him out of a moving car and damaged his frontal lobe.
We see an interview between Heimdahl and Piers Morgan in which Morgan asks Heimdahl his intentions. Heimdahl states that he thinks the world would be better off without governments, and thus he plans to take them all down.
Jericho is taken out of prison for the procedure to begin. Bill's memories go into his head, but the procedure nearly kills Jericho. Later, Wells and the other agents view a video message from Strook, who says he will give the CIA his program in exchange for protection and money, as he had originally been working with Heimdahl, but once Strook changed his mind, Heimdahl got furious and is after him now. Strook is then seen calling the Pope home to ask for Bill, but Jill informs Strook that her husband is dead.
After the memory transplant succeeds, Jericho is being transferred by two agents, but he uses a makeshift hook to cut one of the agents and lead to a crash that results in him escaping. He has the cars blow up to make it look like he died.
Jericho makes it into town and steals some food and beats up some men to take their van. He then heads over to the Pope house to find the bag of money. He ties Jill up in her bed. All the while, he begins to see some of Bill's memories, most of them involving his time with Jill, but also a vision of the money bag being hidden behind a shelf of George Orwell books. Jericho goes back to the room and unties Jill. He then gets in touch with Ruiza through the home phone, claiming Emma may have hit a button again. Jericho then flees the house.
We see another video of Strook stating his plans to sell his program to the Russians now out of fear that the CIA has betrayed him, and the CIA has roughly nine hours to respond to Strook's deadline.
Back on the streets, Jericho continues seeing Bill's memories, and he is starting to gain Bill's personality and skills while jumping between that and his natural self. Jericho tries to get himself a drink and orders it in French, mistaking it for Spanish, and one man corrects him before calling him a motherfucker, leading to Jericho breaking the man's nose. He then heads to the library and logs into the computer with Bill's codes, which the CIA discovers.
Jericho finds Franks to help him get medication for his head hurting as a result of Bill's memories overwhelming him. It means that Jericho is now able to develop emotions. Their whole encounter is monitored by the CIA. As he leaves the pharmacy, Jericho is taken by several agents. Elsa, who was watching, follows.
After a tense encounter at the headquarters between Jericho and the other agents, Jericho is being escorted by Wells to another location. Heimdahl creates a distraction by making it look like Strook was spotted at an airport. This leads to Elsa and Heimdahl's other goons to find the agents and start shooting at them, resulting in the deaths of some agents including Lynch. Jericho escapes the shootout by driving off a bridge.
Jericho returns to the Pope house. Jill points a gun at him this time, but Jericho is less hostile this time, and he tells her a memory only she and Bill would know to prove he has Bill's memories. It's about how their first car smelled like fish and chips, and the exhaust blew out a week later. Jill later sees Jericho outside with Emma as they bury one of her toys. Despite being worried at first, Jill realizes that Jericho would not hurt her or Emma. She lets him stay the night.
The next morning, Jericho discovers that the money bag is hidden behind a bookshelf in the library at the university where Jill works. He heads there to retrieve it, leaving Elsa to break into the Pope house and abduct Jill and Emma, while Heimdahl gets Jericho. Wells and his team learn of this, and they head out after them, while the Russians have their own team out looking for Strook.
Both the CIA and the Russian team circle the university as Heimdahl's goons take Jericho away. He then remembers that Strook is hiding in Jill's office. Elsa forces Jericho to guide her to the office. They pass by the lab, which lets Jericho make a bomb to get away from Elsa. He rushes to Jill's office to find Strook and talk to him, but Elsa finds them. She shoots Strook in the head and nearly takes the drive with his program until Jericho emerges and beats her to death with a lamp.
Jericho races to the airfield where Heimdahl is planning to escape with Jill and Emma, despite Wells telling Jericho it's too risky and that lives are at stake. Jericho makes it there and reluctantly hands the drive to Heimdahl so he can let Emma go. Heimdahl shoots Jericho and makes his escape on his plane right before Wells and his men arrive. As Wells yells at Jericho for what he's done, Jericho reveals that he had Strook reprogram the wormhole so that anything launched from that program would hit wherever the launch was made. Therefore, the missile that Heimdahl launched to hit the airfield ends up flying back toward his plane, blowing him (and the wormhole) up.
A while later, we see Jericho at the beach he was standing at in the beginning. He is met by Jill and Emma, along with Wells and Franks, and some other agents. Jill and Emma know that Bill lives on in Jericho's head. Wells then tells Franks that he is going to offer Jericho a job.