Jamal's flashbacks begin with his managing, at age five, to obtain the autograph of Bollywood star Amitabh Bachchan, which his brother then sells, followed immediately by the death of his mother during the Bombay Riots. As they flee the riot, Salim and Jamal meet Latika, another child from their slum. Salim is reluctant to take her in, but Jamal suggests that she could be the third musketeer, a character from the Alexandre Dumas novel (which they had been studying—albeit not very diligently—in school), whose name they do not know. The three are found by Maman (Ankur Vikal), a gangster who tricks and then trains street children into becoming beggars. When Jamal, Salim, and Latika learn Maman is blinding children in order to make them more effective as singing beggars, they flee by jumping onto a departing train. Latika catches up and takes Salim's hand, but Salim purposely lets go, and she is recaptured by the gangsters. Over the next few years, Salim and Jamal make a living travelling on top of trains, selling goods, picking pockets, working as dish washers, and pretending to be tour guides at the Taj Mahal, where they steal people's shoes. At Jamal's insistence, they return to Mumbai to find Latika, discovering from one of the singing beggars that she has been raised by Maman to become a prostitute and that her virginity is expected to fetch a high price. The brothers rescue her, and Salim draws a gun and kills Maman. Salim then manages to get a job with Javed (Mahesh Manjrekar), Maman's rival crime lord. Arriving at their hotel room, Salim orders Jamal to leave him and Latika alone. When Jamal refuses, Salim draws a gun on him, and Jamal leaves after Latika persuades him to go away (presumably so he wouldn't get hurt by Salim).
Years later, while working as a tea server at an Indian call centre, Jamal searches the centre's database for Salim and Latika. He fails in finding Latika but succeeds in finding Salim, who is now a high-ranking lieutenant in Javed's organisation, and they reunite. Salim is regretful for his past actions and only pleads for forgiveness when Jamal physically attacks him. Jamal then bluffs his way into Javed's residence and reunites with Latika. While Jamal professes his love for her, Latika asks him to forget about her. Jamal promises to wait for her every day at 5 o'clock at the VT station. Latika attempts to rendezvous with him, but she is recaptured by Javed's men, led by Salim. Jamal loses contact with Latika when Javed moves to another house, outside of Mumbai. Knowing that Latika watches it regularly, Jamal attempts to make contact with her again by becoming a contestant on the show Who Wants to Be a Millionaire? He makes it to the final question, despite the hostile attitude of the show's host, Prem Kumar (Anil Kapoor), and becomes a wonder across India. Kumar feeds Jamal the incorrect response to the penultimate question, and when Jamal still gets it right, turns him into the police on suspicion of cheating.
Back in the interrogation room, the police inspector (Irrfan Khan) calls Jamal's explanation "bizarrely plausible", but thinks he is not a liar and allows him to return to the show. At Javed's safehouse, Latika watches the news coverage of Jamal's miraculous run on the show. Salim, in an effort to make amends for his past behaviour, quietly gives Latika his mobile phone and car keys, and asks her to forgive him and to go to Jamal. Latika, though initially reluctant out of fear of Javed, agrees and escapes. Salim fills a bathtub with cash and sits in it, waiting for the death he knows will come when Javed discovers what he has done. Jamal's final question is, by coincidence, the name of the third musketeer in The Three Musketeers, a fact he never learned. Jamal uses his Phone-A-Friend lifeline to call Salim's cell, as it is the only phone number he knows. Latika succeeds in answering the phone just in the nick of time, and, while she does not know the answer, tells Jamal that she is safe. Relieved, Jamal randomly picks Aramis, the right answer, and wins the grand prize. Simultaneously, Javed discovers that Salim has helped Latika escape after he hears Latika on the show. He and his men break down the bathroom door, and Salim kills Javed, before being gunned down himself at the hands of Javed's men. With his dying breath, Salim gasps, "God is great." Later that night, Jamal and Latika meet at the railway station and kiss. The movie ends with a dance scene on the platform to "Jai Ho".