The film is set in the 1920s during the period of growing influence of the Indian independence movement in the British Raj. Mrs. Moore (Peggy Ashcroft) and Adela Quested (Judy Davis) sail from England to India, where Ronny Heaslop (Nigel Havers), the older woman's son and younger woman's fiancé, is the local magistrate in the provincial town of Chandrapore. Through school superintendent Richard Fielding (James Fox), the two visitors meet eccentric elderly Brahmin scholar Professor Godbole (Alec Guinness), and they befriend Dr. Aziz Ahmed (Victor Banerjee), an impoverished widower who initially meets Mrs. Moore in a moonlit mosque overlooking the Ganges River. Their sensitivity and unprejudiced attitude toward native Indians endears them to him. When Mrs. Moore and Adela express an interest in seeing the "real" India, as opposed to the Anglicised environment of cricket, polo, and afternoon tea the British expatriates have created for themselves, Aziz offers to host an excursion to the remote Marabar Caves.
The outing goes reasonably well until the two women begin exploring the caves with Aziz and his sizable entourage. Mrs. Moore experiences an overwhelming sense of claustrophobia that forces her to return to the open air. She encourages Adela and Aziz to continue their exploration but suggests they bring only one guide. The three set off for a series of caves far removed from the rest of the group, and before entering Aziz steps aside to smoke a cigarette. He returns to find Adela has disappeared; shortly after he sees her running headlong down the hill, bloody and dishevelled. Upon their return to town, Aziz is jailed to await trial for attempted rape, and an uproar ensues between the Indians and the Colonials.
The case becomes a cause celebre among the British. When Mrs. Moore makes it clear she firmly believes in Aziz's innocence and will not testify against him, it is decided she should return to England. She subsequently suffers a fatal heart attack during the voyage and is buried at sea.
To the consternation of her fiancé and friends, Adela has a change of heart and clears Aziz in open court. The Colonials are forced to make an ignominious retreat while the Indians carry the exonerated man out of the courtroom on their shoulders, cheering wildly. In the aftermath, Miss Quested breaks off her engagement and leaves India, while Dr. Aziz abandons his Western attire, dons traditional dress, and withdraws completely from Anglo-Indian society, opening a clinic in Northern India near the Himalayas. Although he remains angry and bitter for years, he eventually writes to Adela to convey his thanks and forgiveness.