One of the most anticipated films showing at this year’s Toronto International Film Festival caused so much controversy it had to be shot in secret, the director said.

Canadian filmmaker Deepa Mehta’s “Midnight's Children” is based on Salman Rushdie’s award-winning literary classic that follows children born on the day of India’s independence.

Rushdie spent 10 years in exile due to controversy surrounding his writings.

Also, his 1988 book "The Satanic Verses," prompted the late Ayatollah Khomeini to issue a fatwa on the author’s head. 

Mehta has garnered controversy in India for her past work, including 2005's “Water.”

“I’m not exactly popular with Hindi fundamentalists, and Salman is not exactly popular with Islamic fundamentalists,” Mehta said in an interview with CTV News.

So she filmed in Sri Lanka; locations were kept secret, actors and crew kept quiet, and a new title was found.

“We had a working title for it. The stupidest name we could think of, "Winds of Change." I mean, it's really bad,” she said.

Still, production was halted after four weeks, and the crew had to temporarily move their equipment to the Canadian High Commission, producer David Hamilton told The Canadian Press.

Only after Hamilton and Mehta appealed the order did Sri Lankan President Mahinda Rajapaksa permit shooting to resume.

Iran also protested this latest adaption of “Midnight's Children.”

When it came to the film rights, Rushdie drove a hard bargain.

“He thought about it for a second and he said, ‘I think I could give you the option for one dollar,’ and he did,” Mehta said.

The two worked for four years, taking a book described by some as "unfilmable" and filming it

“There were 64 locations. At times we had more than 3,000 extras for a scene and one elephant that ran away,” Mehta said.

To help manage the gruelling 60-day shoot, the director joined a gym, got a trainer and quit smoking.

“Salman keeps going on about how he saved my life because I’m giving up smoking,” Mehta said.

Rushdie called the epic tale his "love letter to India." Mehta hopes audiences feel the same.

“I love this film so much. I want them to love it as much as I do, that's all,” she said.

“People are predisposed to loving it because it's Deepa's film, it's Salman's book,” said actress Shahana Goswami, who plays Amina.

“Midnight's Children” gala premiere is this Sunday night in Toronto. It opens nationwide Nov. 2.

With a report from CTV’s Seamus O'Regan and files from The Canadian Press