After stopping a bank robbery, Hancock (Will Smith) goes out to dinner with Ray (Jason Bateman) and Mary (Charlize Theron). At dinner, he reveals he is over 80 years old and the last thing he remembers is waking up in a hospital with two tickets to a movie.
After returning home, Ray passes out. Once that happens, Hancock and Mary are talking and Hancock tries to kiss Mary. Once he does this, Mary throws him through the wall and tells him to stay away from her family. Hancock returns to tell Mary they need to talk or he tells Ray the truth.
She goes to him and tells him she is his opposite and is stronger. After she does not give him the information he wants, he flies to tell Ray about her, she gives chase and they fight. Ray finds out she has powers as well and she explains that technically, she is still married to Hancock.
It turns out Mary and Hancock were specifically built to be heroes and have lived at least since the Roman period. They were married and it was her he went to the movies with the night he had his accident. However, they are each other’s weakness, meaning the closer they stay to each other, the more mortal they become. During a robbery 80 years ago, Hancock is hit and has amnesia, so Mary leaves because Hancock was made to be a hero. Hancock is hurt that she made him think he was alone all those years and leaves.
Losing the fight, Hancock goes to the liquor store as it is robbed and is shot down, since he lost his powers. At the hospital, Ray and Mary come to see him as thugs from the bank robbery Hancock stopped earlier also arrive. They shoot down Mary, which gives Hancock his powers back briefly. He fights the thugs as Mary is dying. The mastermind behind it shoots Hancock multiple times until Ray kills him before he shoots again. Hancock and Mary seem to die, then Hancock wakes up and struggles to get away from Mary so she does not die.
It ends with Mary and Ray together in LA as Hancock calls Ray from New York to thank him.