As a young boy of 8, Bruce Wayne falls down a well in the backyard of his home while playing with his friend Rachel Dawes, where he is caught in a swarm of bats. Bruce is rescued by his father Thomas, but he is left with a fear of bats. When Bruce and his parents attend the opera Mephistopheles, Bruce is frightened by the portrayals of bat-like demons in the performance. He and his parents leave early and exit into a backalley, where they are confronted by an armed mugger, Joe Chill, who shoots and kills Bruce's parents. Chill is arrested and convicted for the double murder, but Bruce is left traumatized by the incident. The family's butler, Alfred Pennyworth, raises Bruce in the absence of his parents.
When Bruce becomes a young man, he returns home to Gotham City from Princeton University, intent on killing Joe Chill, whose prison sentence is being suspended in exchange for testifying against the mob boss Carmine Falcone. Chill is assassinated by one of Falcone's henchmen however, depriving Bruce of his opportunity. When Bruce admits to Rachel about his foiled plan, she expresses disgust and gives him a lecture about the difference between justice and revenge. Realizing she is right, Bruce decides to confront Falcone himself, but the mob boss dismisses him as ignorant of nature of the underworld, saying, "You're Bruce Wayne, the Prince of Gotham—you'd have to go a thousand miles to find someone who doesn't know your name!" and throws Bruce out with his thugs roughing him up for good measure. Realizing that Falcone is right, and that he cannot truly understand what he intends to fight as a wealthy playboy, Bruce abandons his life at home, stowing away on a cargo ship and traveling the world for the next seven years.
He associates with criminals to learn their ways and is thrown in a Bhutanese prison by police for theft of, ironically enough, Wayne Enterprises property. After a prison brawl, an enigmatic man who identifies himself as Henri Ducard invites Bruce to join an elite vigilante group, the League of Shadows, under the leadership of Ra's al Ghul. Bruce is freed the next day and travels to the top of a Tibetan mountain to begin his combat training with the League. In his training, Bruce overcomes his fear of bats while under the hallucinogenic influence of a mountainside blue flower. However, Bruce soon realizes that he will be forced to lead the League in its fight to restore order to Gotham by creating chaos and murdering its population. When Ducard orders Bruce to execute a murderer as a final test, Bruce refuses to obey and destroys the League's headquarters, killing Ra's in the process. However, Bruce rescues an unconscious Ducard from the wreckage and leaves his mentor at a nearby village.
Bruce returns to a Gotham City that is mostly ruled by Falcone and begins plotting a one-man war against the corrupt system. He seeks the help of Rachel, now an assistant district attorney, and police sergeant Jim Gordon, who consoled him in the aftermath of his parents' murder. Bruce pays a visit to Gordon one night in disguise to establish communication. After reestablishing his connections to his father's company, Wayne Enterprises, Bruce is able to acquire, with the help of former board member Lucius Fox, a prototype armored car and an experimental armored suit. He augments the suit with League of Shadows armor, and a special cape that can become a rudimentary hang glider. Inspired by his childhood fear, Bruce takes up the vigilante identity of "the Batman" and sets up a base in the caves beneath Wayne Manor.
During his first night as Batman, he disrupts a drug shipment by Falcone, and leaves the mob boss tied to a searchlight, forming a makeshift Bat-Signal. He also disrupts an assassination attempt on Rachel, leaving her with evidence against a judge that has gone soft on Falcone in the past. In prison, Falcone meets with Dr. Jonathan Crane, a corrupt psychiatrist whom he has helped smuggle drugs into Gotham, and threatens to reveal his complicity if he does not declare him mentally unfit for trial. Crane puts on a ragged burlap mask and sprays Falcone with a fear-inducing hallucinogen that drives him insane (which causes Falcone to constantly mouth the word "Scarecrow"), and has him transferred to Arkham Asylum.
While investigating a shipment he's intercepted of the odd drugs, Batman is ambushed by Crane, who sprays him with fear toxins. Bruce is rescued by Alfred, administered an antidote for the toxin developed by Fox and awakens two days later on his thirtieth birthday. Rachel meanwhile goes to confront Crane on what she sees as corruption, only to wind up poisoned after being shown that the toxin is being piped into Gotham's water supply. She is saved by Batman. The police enter the asylum, and Batman escapes with Rachel in his Batmobile. After administering the antidote to Rachel in his cave, he gives her two vials of it to deliver to Gordon - one for the detective to inoculate himself, and another to mass-produce for the city's population.
Later at the birthday party held at his mansion, Bruce, much to his surprise and shock, is confronted by Ducard and a group of ninjas from the League of Shadows, who then reveals himself to be the real Ra's al Ghul, the former who died being a decoy. Ra's, who had been conspiring with the Scarecrow the entire time, plans to destroy Gotham by distributing the toxin (which was extracted from the mountainside blue flowers) undetected via Gotham's water supply, and then vaporize it with a microwave emitter stolen from Wayne Enterprises. Bruce, tricking his guests into leaving, fights briefly with Ra's while the League of Shadows set fire to Wayne Manor. Bruce escapes the inferno with Alfred's help just as the manor is destroyed.
Batman arrives at the "Narrows" section of Gotham to aid the police, who are engaged in battle with psychotic criminals set free from Arkham Asylum by the League. Ra's loads the microwave emitter onto Gotham's monorail system, intending to release the drug as the train travels toward the city's central water source. After saving Rachel and revealing his identity to her, Batman leaves Gordon in control of the Batmobile to stop the train before it reaches the city's central water hub while Batman himself battles Ra's. Just as Gordon topples the elevated line using the Batmobile's missiles, Batman refuses to kill Ra's, but also chooses not to save him, gliding from the train and leaving Ra's aboard as it crashes and explodes, killing him.
Following the battle, Batman becomes a public hero. Bruce gains control of Wayne Enterprises and installs Fox as CEO, firing Earle. However, he is unable to hold onto Rachel, who cannot reconcile her love for Bruce Wayne with his dual life as Batman, though she promises to wait for him. Gordon, newly promoted to lieutenant, unveils a Bat-Signal for Batman and mentions a new criminal on the scene that, like Batman, has "a taste for the theatrical", leaving a Joker playing card at his crime scenes. Batman promises to investigate and Gordon mentions that he forgot to thank Batman for his efforts. Batman replies by saying that he'll never have to, as he takes off into the night.