Despite its status as an award-winning literary classic, Salman Rushdie’s Midnight's Children took years to make the transition to the movie screen.

The Indo-British author's magical realist epic — long described as "unfilmable" — will be unveiled Sunday at a prestigious, red carpet gala at the Toronto International Film Festival, where it's among this year's most anticipated titles.

Set against the birth of modern India through the independence and partition era, Midnight's Children blends fantastical, magical elements with historical events. Noted Indo-Canadian filmmaker Deepa Mehta first took up the challenge of adapting the tale about four years ago and has been collaborating all the while with Rushdie, who offered her the film rights for $1 to help kick-start the production.

'When he writes about the characters, I know them. Those are like my aunts. That's my mother. That's my grandfather...I know the ghettos. I can smell them' —Deepa Mehta

"We started talking about, 'Let's work together,'" Mehta recalled to CBC News.

"

[Rushdie] said, 'Which book do you really want to do?' I don't know where this came from but I just said Midnight's Children … and he said 'Done.'"

Their ability to collaborate "had a lot to do with coming from the same kind of a background in India, being of practically the same generation," Mehta said.

"When he writes about the characters, I know them. Those are like my aunts. That's my mother. That's my grandfather. Not exactly, but similar. I know the school [the book's protagonist] Saleem [Sinai] went to. I know the ghettos. I can smell them," she added.

'A very ambitious subject'

Like the novel, the film follows the lives children born at midnight on Aug. 15, 1947, the moment India gained independence. The children — who discover they have mysterious powers — become intertwined with one another and their fates also become linked to that of the country.

si-getty-mehta-rushdie-12480378

Deepa Mahta and Salman Rushdie spoke about Midnight's Children at TIFF in 2011. (Jerod Harris/Getty Images)

"This was a very ambitious subject [and] topic for her to take on. Intimate, but also an epic at the same time. Deepa's really managed to pull it off," said TIFF CEO Piers Handling, a colleague of Mehta's who was shown an early version of the film and offered his suggestions.

"She's got a laser strong sense in terms of what she actually wants to achieve as a filmmaker but she's also a great listener. She's polished it into a real gem of a film," he said. "It does a perfect job in terms of adapting the novel."

The extensive cast of Midnight's Children includes actors hailing from India, Canada and the U.K., including Satya Bhabha, Shahana Goswami, Rajat Kapoor, Seema Biswas, Shriya Saran, Siddharth, Ronit Roy, Rahul Bose, Anita Majumdar, Zaib Shaikh and Anupam Kher.

"Deepa's now risen to become one of the best known filmmakers in the world," Handling said.

"She's making films for a broad general public while at the same time staying true to her roots as an Indian-Canadian filmmaker."

Controversial pair

Along with their shared Indian heritage, both Mehta and Rushdie are no strangers to controversy.

Oscar-nominated Mehta's film shoots in India have been the subject of violent protests by religious fundamentalists for broaching topics such as homosexuality (Fire), interfaith romance (Earth) and the plight of widows (Water). For the latter, she was forced to shoot in Sri Lanka, with the production cloaked under a different title.

Meanwhile, Rushdie lived in hiding for a decade after he famously became the subject of a fatwa issued by Iranian leader Ayatollah Khomeni. The edict came following the publication of his novel The Satanic Verses, which some Muslims consider blasphemous.

Regardless, the pair were able to adapt Midnight's Children without any major incidents, although the film's shoot in Sri Lanka was stopped for a few days. Luckily, the country's president was on side with the production and helped get filming back on track.

"For me, it's my first and perhaps final gesture of making peace with my motherland," Mehta said of Midnight's Children.

"I love India and today, largely because of the film, I feel I can look at it objectively without feeling I have lost anything. In that sense, when I think of Midnight's Children, I think of finally being at peace with India."