Eighteen months after the destructive battle in Metropolis (Man of Steel), Superman has become a controversial figure. Billionaire Bruce Wayne, who has covertly operated in Gotham City as vigilante Batman for nearly two decades, blames Superman for the mass casualties that resulted from his fight with General Zod. Superman, in his public identity as Daily Planet journalist Clark Kent, sees Batman as dangerous and seeks to expose him.
LexCorp's mogul Lex Luthor also sees Superman as a threat and convinces Senator June Finch to help him recover kryptonite from Zod's failed terraforming attempt from the Indian Ocean. Finch later stonewalls Luthor's efforts to use Zod's DNA and the Kryptonian scout ship recovered from the battle to create a biological weapon.
Wayne successfully infiltrates a fundraiser promoted by Luthor to retrieve data from LexCorp's mainframe, but his drive is stolen by mysterious antiques dealer Diana Prince, who learns that Luthor has files on several "metahumans"; beings with superhuman abilities; herself, as well as a man with superhuman speed (Flash), a cybernetic body (Cyborg), and a man that lives underwater (Aquaman). Wayne later receives the drive back from her after she copies it. While decrypting the drive, he receives a vision of a dystopian future where, while armed with a pistol, he leads a force of rebels against Superman. Batman is captured and held prisoner by Superman's army. Superman approaches him, rips off his cowl and tells him he took everything from him. Superman then rips out Batman's heart.
Wayne is snapped out of the vision by a mysterious time traveler, who warns him that Lois Lane has a crucial role to an impending threat, and that he must find the others. He later learns not only of Luthor's experiments with kryptonite, but also his ongoing investigation about metahumans including Prince herself, who is an immortal warrior. Batman attempts to retrieve Luthor's kryptonite, but is intercepted by Superman, who orders him to cease his activities. Later, Finch summons Superman to a Congressional hearing at the U.S. Capitol to debate the validity of his actions, where Luthor masterminds a bombing that kills dozens of people, including Finch. The public blames the bombing on Superman, who goes into self-imposed exile.
Batman retrieves the kryptonite and prepares to launch a strike against Superman; building a powerful exoskeleton and kryptonite-powered arsenal. With Batman now having the kryptonite, Luthor activates the Genesis Chamber aboard the scout ship and splices his own DNA and Zod's. Luthor endangers Lois to lure Superman to LexCorp Tower, where he reveals that he has been aware of Superman's secrets for some time. Luthor blackmails Superman into confronting Batman by holding his adoptive mother, Martha Kent, hostage at an undisclosed location, anticipating that Batman would kill Superman with his kryptonite.
Superman tries to reason with Batman, revealing that he knows his secrets, but leads to a fight in which Batman nearly kills Superman with a spear he'd fashioned from the kryptonite. Superman pleads for Batman to "save Martha", which was also the latter's late mother's name, causing him to come to his senses and realize Superman is not a threat. Upon learning of Luthor's plan, Batman leaves to rescue Martha while Superman confronts Luthor, who unleashes a monstrous artificially bred creature (Doomsday) made with Kryptonian technology on the crashed ship.
Superman and Batman join forces to fight him and are aided by an arriving Prince in her Amazonian attire, but are outmatched due to the creature's ability to absorb and redirect energy. Realizing that their shared Kryptonian DNA results in shared vulnerabilities, Superman retrieves the kryptonite spear and impales the creature with it, while the creature stabs Superman with his bone protrusions, seemingly killing him.
Luthor is arrested after Lane exposes his numerous crimes; when he is visited by Batman in prison, he gloats that Superman's death has made the world vulnerable to powerful threats, of which he was taught about while manipulating the Kryptonian ship's technology. Batman threatens Luthor, and promises that he will always be watching him. A memorial is held for Superman in Metropolis, and as Clark is also declared dead. Wayne, Lane, Martha, and Prince attend a private funeral for Clark in Smallville. Martha passes an envelope to Lane, which contains an engagement ring from Clark. After the funeral, Wayne reveals to Prince that he plans to form a team (the Justice League) from Luthor's file subjects to protect the world in Superman's absence. Later, a faint heartbeat begins echoing from Clark's grave and the dirt around it begins to levitate