Boston Police Department officers Detective Sergeant Nick Walker and Detective Lieutenant Bobby Hayes discover and steal several shards of gold while on duty. Nick buries his share under an orange tree sapling in his garden; his wife, Julia, thinks that the tree is a surprise gift and mentions how content she is with their life together. Nick realizes that they do not need the gold, and decides to submit it as evidence. During a raid later on, Hayes tells Nick that he can’t let him turn in the gold, and kills Nick, triggering a shootout to cover up the murder. Time stops around Nick and he is drawn into a vortex in the sky, but is suddenly pulled into a room just before he reaches the top of the vortex.

In the afterlife, Nick finds that he faces eternal damnation for his thievery. As penance, Nick is recruited for the R.I.P.D. (The Rest In Peace Department), who are responsible for finding and returning souls who refuse to move on to the afterlife. Left unchecked, these souls become “deados”, monsters disguised as humans, and when their souls begin to rot, the environment rots around them. He is partnered with Roycephus “Roy” Pulsipher, a former U.S. Marshal and Union soldier in the American Civil War. Their first stop is at a cemetery to watch Nick’s funeral, and Nick attempts to make his presence known to Julia but is not recognized. Roy explains that R.I.P.D. officers are given new identities and appearances to prevent them from revealing that the afterlife exists; Nick appears as an old Chinese man while Roy appears as a beautiful blonde woman.

On his first field mission, Nick aids Roy in interrogating a suspected deado and discovers the perpetrator is in possession of gold like he and Hayes had stolen. Nick and Roy submit the gold as evidence before visiting one of Roy’s informants. Nick tricks the informant into revealing Hayes as his contact. They follow Hayes to Nick’s old house, where he “discovers” Nick’s stolen gold. Roy and Nick track Hayes and observe him handing the gold off to a deado whom they stop and interrogate. The deado overpowers them, taking the gold and transforming into a hulking monster that leads them on a chase through the city that attracts the attention of normal humans and causes a panic. When the two return to R.I.P.D. headquarters, Chief Mildred Proctor is informed by “Eternal Affairs” that the gold fragments they found are part of an ancient weapon called the Staff of Jericho, which has the power to reverse the flow of souls from Earth to the afterlife. She also receives orders to remove Roy and Nick from the case and to suspend them from active duty due to the exposure caused by the monster’s rampage.

Roy and Nick argue, and Nick leaves by himself to try again to reveal himself to Julia, but she is unable to recognize him due to his altered identity and she flees. Roy tails him and they argue, but finally make amends as wells as forgiving Nick and decide to work together to stop whatever Hayes is planning. They discover that Hayes is a deado and arrest him, but a confiscated item of his freezes the whole department. Hayes and a group of deados escape with the remainder of the gold and assemble the Staff of Jericho, intending to use it to remain in the living world indefinitely. Hayes takes Julia hostage and stabs her as a necessary human sacrifice to activate the staff. A battle ensues; Pulsipher destroys the Staff of Jericho, and Nick exacts his revenge on Hayes. Being critically wounded by the sacrifice puts Julia close enough to death to see Nick for who he is; they reconcile and share a tearful farewell, with Nick encouraging Julia to continue living for both of them.

Later, Proctor informs Nick that Julia will live. She reinstates them both fully, though she adds 53 years to Roy’s term in the R.I.P.D. due to her revealed affections for him. As a reward, Roy also gives Nick a new appearance, but he is dismayed to find it is that of a Girl Scout.