“Pakistan was the great mistake of his parents, the blunder that had deprived him of his home.” So writes Salman Rushdie in his recent memoir Joseph Anton, speaking of himself in the third person, as if the Ayatollah Khomeini’s fatwa calling for his execution had turned him into one of his improbable fictional characters.

The home Rushdie refers to is India, where he was born in 1947. The mistake is his parents’ decision to move to Pakistan, where his father imagined he might fare better in a nation of fellow Muslims. From what I gather reading Rushdie’s memoir and Midnight’s Children, the novel that brought him literary fame, the heartbreak of his childhood was this “mistake,” the migration out of freewheeling, multi-religious, multi-ethnic India to the militaristic Islamic state of Pakistan, “where the crooked few ruled the impotent many.”

Now adapted as a surprisingly intimate and touching movie directed by Deepa Mehta, “Midnight’s Children” is, as Rushdie has frequently said, his “love letter to India,” and it certainly put Indian writing on the literary map when it was published in 1981. Though born of deep feeling, it explodes on the page as a fireworks of language and outlandish events, skimming over the realm of emotion. It has taken Mehta’s film, 30 years later, to discover the human aspect of the celebrated novel.

Author Salman Rushdie and director Deepa Mehta

Saleem Sinai, the hero of Rushdie’s triple Booker Prize-winning epic, is born at the stroke of midnight on August 15, 1947, at the instant India wins freedom from British rule. Historically, the jubilation of independence was overshadowed by the horror of Hindu-Muslim bloodshed during the partition, when predominantly Muslim areas in eastern and western India were appropriated to form the Islamic nation of Pakistan. The last, hurried, catastrophic gesture of the British, partition stands out as one of the deadliest episodes in modern history. Almost a million people were killed, and more than 12 million lost their homes in fleeing across the new borders. Saleem, born in cosmopolitan Bombay, far from the embattled provinces torn apart by dividing lines, undergoes his own wrenching partition 11 years later when his family leaves India for Pakistan, exiling him from a chaotic, intermingled community of Hindus, Muslims and Parsis to a God-centered country that he wails is “a complete dump!”

Because of his fateful birth at India’s crucial midnight, Saleem proclaims himself his homeland’s twin, “my destinies indissolubly chained to those of my country.” In all ways, the ungainly, cucumber-nosed protagonist’s misadventures trace the Indian subcontinent’s tumultuous history following independence.

Rushdie spins a world of conflicts and corruption with formidable verbal virtuosity and deft comedy. Saleem, his cipher of history, witnesses the 1965 Indian-Pakistani War and fights in the 1971 civil war between East and West Pakistan, in which India intervenes. A magical turn of events takes him back to his beloved India, but soon India is trapped in Indira Gandhi’s draconian “state of emergency,” when freedoms are squashed and political opposition suppressed. Though details of Saleem’s biography mirror Rushdie’s, the volleys of words on the page, their ferocious energy, seem to mimic the rip-roaring force of historical events, overwhelming the character and at times leaving the reader spinning in a kaleidoscope of language.

At the movie’s Atlanta screening in February, Rushdie allowed that Hollywood studios considered the novel “unfilmable.” The movie is different in tone and scale from the book, making Saleem and his family human, ordinary and, yes, understandable, in a way that the book’s irrepressible wordplay and torrents of clever prose resist. I met a writer who is reading the novel now, after attending the movie preview, who says she would not have understood Rushdie’s story if it weren’t for Mehta’s film. Sometimes the question isn’t “Is the movie as good as the book?” but “Is the movie a bridge?”

Like the novel, the film begins with the intimate exploits of Saleem’s progenitors: his grandfather’s comic doctor-patient romance with his grandmother in a paradisal Kashmir; his mother’s love affair with a cowardly poet; her unlikely marriage to his businessman father. The heart of the film lies in Saleem’s own unhappy family, but he nonetheless experiences a charmed childhood in a lush, tropical Bombay, where the wealthy Sinais occupy a magnificent villa in an era before building booms. (Congested modern Mumbai has obscured colonial Bombay, and Mehta shot most of her film in Sri Lanka.)

With a spectacular ensemble cast of veteran Indian actors and the delightfully comic Darsheel Safary as the child Saleem, Mehta offers a glowing, sensuous picture of an affluent domestic world marred by contention. Father Ahmed (Ronit Roy) is a demanding alcoholic. Mother Amina (Shahana Goswami) is still in love with the poet. Mary Pereira is the beloved nanny and switcher of destinies. Saleem (Satya Bhabha as an adult) is not who he appears to be.

Twinning and mixed-up identities drive the plot of both the novel and film, as if behind Rushdie’s wizardry in recasting history as farce and myth lies a simple wish that Hindus and Muslims could be brothers — are brothers, interchangeable people. Saleem, raised by Muslim parents, is actually born to a poor Hindu woman, who dies in childbirth, and her street-singer husband. (But it’s intimated that the baby’s real father is a creepy, departing Englishman.) The actual Saleem Sinai, the one born Muslim, is raised by the impoverished street singer, who names him Shiva, after the Hindu god of destruction.

Mehta beautifully depicts the scene in which the newborns are switched. In a colonial hospital, the Christian nurse, Mary Pereira, carries out the furtive act, hoping to right some wrongs in the world. But the significance of the switch can’t be that a rich kid grows up poor and a poor kid rich, as the nurse decides is just; surely Rushdie means to make the point that a Hindu boy grows up Muslim and a Muslim boy grows up Hindu, both loved by their parents, who don’t know the difference. The significance has to be that our identities are not intrinsic to us: they are roles we learn to play.

As a boy, Saleem discovers a telepathic connection to hundreds of “midnight’s children” born across India, each endowed with a special supernatural power. His power is to draw them together in “conferences’ in his mind. Mehta, who shuns special effects, depicts these as more or less realistic gatherings of India’s diverse children of all economic classes and ethnicities.

Saleem’s leadership is eventually opposed by Shiva, a street hoodlum who asserts himself as a rival and turns the conferences into belligerent meetings during which he evokes the voice of the worst of India’s thug-politicians. Mainly, though, the filmmaker uses the meetings to advance a triangle involving the adolescent Saleem, Shiva and a charming girl magician known as Parvati the Witch.

While Mehta and Rushdie collaborated on streamlining the 533-page novel into a feature-length movie, Rushdie alone wrote the screenplay. He also provides the film’s voice-over narration, quoting passages from the book, because Mehta wanted to imbue the film with some of the novel’s literary dazzle. (They are friends, and Rushdie sold Mehta the option for the movie for $1.)

But acting powers movies, and Mehta has drawn many wonderful performances from her cast. It’s striking how sensitive and nuanced Indian actors can be when the histrionics of Bollywood cinema are not demanded of them. Mehta’s films focus tightly on human relationships against the constraints of society (famously in “Fire,” “Earth” and “Water,” “her Elements Trilogy”), and she has a unique method of preparing actors. A month before the shoot, she gathered the cast of “Midnight’s Children” in Mumbai and put them through a series of exercises and scenarios based on ancient principles of Sanskrit dramaturgy from the Natya Shastra, a 2,000-year-old treatise on the performing arts.

These rehearsals, Mehta told me, were a time for the actors to explore “the emotional arc of the characters” and penetrate their motivations, using a tableau of nine essential emotions. It’s to this intensive process of actors working without the script and looking inward that she attributes the fresh, revelatory acting onscreen.

In its best moments, the film exposes the feeling of the human condition on the subcontinent in an instant. Such as the gaze of doomed longing with which Amina’s old lover adores her during an illicit meeting in a café. Or a magical musical performance by Saleem’s beautiful sister Jamila (Soha Ali Khan), who becomes the celebrated “Nightingale” of Pakistan after the family emigrates there. The pathos of the girl sitting inside a diaphanously curtained canopy onstage, caged behind layers of veils as she sings a heart-rending ghazal, has the transcendent feeling of a lived moment.

In Pakistan, Saleem eventually loses his ability to connect with the other midnight’s children, his intimate human map of India. He grows into an adult and loses his family to war. The movie turns dark and grim with these losses, surreal at moments, expanding in scale to take in the region’s conflicts. Buffeted by the currents of history from Pakistan to the emergent Bangladesh (formerly East Pakistan) to India, Saleem is a victim, soldier and eventually a prisoner.

This period of post-independence wars feels entirely different in tone from the film’s first half about family life, more akin in style to Rushdie’s novel as its mood grows despairing. Immersed in the collision of the personal and political, the camera even swings into Indira Gandhi’s prime ministerial offices (“the Widow,” as she’s known here) as her astrologer absurdly identifies Saleem and the other children of midnight — of India, of freedom — as her enemies.

Yet ultimately Mehta asserts her own vision over volatile history, homing in on the intimate, loving and familial as the lasting source of hope. Her movie of “Midnight’s Children” challenges the novel’s pessimistic ending of a fractious nation crumbling to pieces. India, abysmally corrupt but now prospering and innovative, continues to write the unpredictable story of its future.

Parul Kapur Hinzen writes about books. Born in Assam, India, she immigrated to the United States at age seven and has an MFA from Columbia University. After a stint at the United Nations press office in New York, she lived in Frankfurt, Paris, London and SaoPaulo. Her work has appeared in The New Yorker, Newsday, The Wall Street Journal Europe, The American Book Review, Art in America,ARTnews and The Atlanta Journal-Constitution. Her first novel, Inside the Mirror, was a semi-finalist in the 2013 Horatio Nelson Prize for Fiction. She has published short fiction in Wascana Review, Frank (Paris) and the Amherst Review. Her website is www.parulkh.com.