By FRED KAPLAN

April 19, 2013

It seems far-fetched that “The Reluctant Fundamentalist,” Mohsin Hamid’s 2007 best-selling novel, would be turned into a movie. First, there’s its narrative structure. A young man greets an American tourist in a cafe in the Pakistani city of Lahore and proceeds to tell his life story. That’s the entire book; we never hear from the American or anyone else.

But also, the young man, Changez Khan, is a bearded Pakistani radical, not a sympathetic type on American screens. Finally, as the tale unfolds, clues mount that he might be a terrorist and the American might be a spy who has come to kill him, although this remains ambiguous — a literary trait hard to capture on film.

And yet the movie is opening on Friday, directed by Mira Nair, who may also seem an odd choice — “an Indian director making a Pakistani film in America,” as she puts it.

From another angle, though, Ms. Nair is a natural fit. Her father was raised in Lahore before the partitioning that carved out Pakistan as a separate nation. Later, as a lawyer in New Delhi, he helped found the India-Pakistan Friendship Society. Ms. Nair first visited Lahore only in 2004, when she was 47, as a result of a speaking invitation. (Her films are popular in Pakistan as well as in her native India.)

“The trip had a big impact on me,” she recalled in an interview in her apartment on Manhattan’s Upper West Side. “There was this incredible feeling of familiarity — the hospitality, the music, the artistic expression: modern paintings are everywhere. We never see this aspect of contemporary Pakistan on our screens.”

She resolved to change that. Two years later she read Mr. Hamid’s novel in galleys, saw it as an ideal vehicle and arranged to meet the author in London, where he was living. A fan of her films, he sold her the rights and helped with some early drafts of the screenplay.

In “The Reluctant Fundamentalist,” opening on Friday, Mira Nair faced the challenge of adapting a book centering on a long conversation between a Pakistani and an American with ambiguous identities.

Chester Higgins Jr. / The New York Times

Ms. Nair made clear that for cinematic reasons, they would have to fill in some of the novel’s blanks. They had to establish who these two characters are from the beginning. (Along with the screenwriter William Wheeler, they decided that the American was a C.I.A. officer working undercover as a journalist and that the Pakistani was a popular professor with militant connections.) And they had to decide what happens at the end — what the characters do after the novel’s deliberately inconclusive last page, and how their actions reflect not just their roles in world politics but also their value as human beings.

It’s a risky proposition commercially to make a film about a clash of ideas in a foreign country, much less the clash of these ideas in Pakistan. And in fact this film almost wasn’t made. One prospective investor offered Ms. Nair’s longtime producer, Lydia Dean Pilcher, $2 million. Ms. Nair recounted that when the investor was told that the budget would have to be much higher, he replied: “You have a Muslim as protagonist. Two million is all it’s worth.”

(The Doha Film Institute in Qatar, which had initially agreed to finance half the film’s budget, stepped in to cover the entire cost. which amounted to just under $15 million. It will be distributed in the United States by IFC Films.)

The film, starring Riz Ahmed as Changez and Liev Schreiber as the American, received mixed-to-positive reviews when it opened the Venice International Film Festival last August. Time magazine called it “tense, thoughtful and truly international.” The Guardian praised its “bold and muscular storytelling” but cringed at the adaptation’s “rather feeble liberal-humanist” touches.

“Liberal humanist” does sum up Ms. Nair’s perspective and intentions. “The book is about the mutual suspicion that the two men and the two countries, America and Pakistan have of each other,” she said. “In my film, we use the enigma of the situation — is he a spy, is he a terrorist, are neither, are both? — as the springboard for a dialogue, a bridge connecting them, and connecting us, making each of us see ourselves in what we had regarded as ‘the other.’ ”

Mr. Hamid had no problem with the changes or this concept. In some ways, he is much like his book’s main character. Both were born and raised in Lahore, Pakistan’s second-largest city; both left home to attend Princeton, then took a high-powered job with a corporate consulting firm in New York (in real life, McKinsey & Company). At the peak of their success, both the author and Changez felt like fully assimilated Americans — Mr. Hamid more so, because he had spent his early childhood in California, in the mid- to late 1970s, while his father studied for a doctorate at Stanford.

A turning point, in fiction and in life, came with the attacks of Sept. 11. In the book and the film, Changez is harassed because of his South Asian appearance — strip-searched at an airport, questioned by the F.B.I., betrayed by those around him. Alienated from his new homeland, he reassesses his identity and rejects his profession, which involves assessing the value of companies and shutting them down if they fall short of market “fundamentals.” Then he returns home, where he is tempted by a different sort of fundamentalism.

Riz Ahmed as a successful Pakistani working in New York and Kate Hudson as his girlfriend in “The Reluctant Fundamentalist.”

Reluctant Films II

The novel’s most notorious scene — and it will probably be the movie’s, too — has Changez recalling the moment when he watched the twin towers collapse. “I smiled,” he tells the American. “Yes, despicable as it may sound, my initial reaction was to be remarkably pleased” that “someone had so visibly brought America to her knees.”

Mr. Hamid emphasized in a telephone interview from Lahore, where he now lives, that this was not at all his own reaction to the terrorist attacks, but that he had witnessed it in others. He had moved to London a month before the attacks and was in a local gym when a television newscast showed the first tower crumbling.

“I looked around,” he remembered, “and saw that some people were smiling. These weren’t people who looked like me; they were white people. For days, I saw this recurring, people happy, people joking. If I mentioned the human suffering to these people, some said they were ashamed of the way they felt. It was the symbolism of the act that pleased them.”

He had initially intended to move back to New York after a year. “Someone like me, with my background, could manage the visa maze,” he said. “But my parents and my friends from that part of the world would have had a much harder time visiting me.” So he stayed in London until 2010, when he, his wife and daughter moved back to Lahore, living with both sets of parents in a large trigenerational house.

“The biggest difference between Changez and me,” Mr. Hamid said, “is that he feels he has to pick one or the other — Pakistan or America. I profoundly do not feel that way. I feel myself completely hybridized, mongrelized, American and Pakistani, all mixed up. A lot of people say, ‘Protect us from this contamination.’ But I’m a rah-rah supporter of that contamination. Without that, people like me don’t get to exist. I don’t want to pick sides.”

In that sense, he and Ms. Nair, though 14 years apart in age, have similar life stories. She first left India in 1976 to attend Harvard. Many of the films she’s made over the years since — “Monsoon Wedding,”“The Namesake,”“Mississippi Masala” and even her first feature, a 1982 documentary, “So Far from India” — have been about people who are split between two cultures, two homelands, and feel that they have to choose.

Yet, like Mr. Hamid, she doesn’t feel that way about herself. Her husband of 22 years, Mahmood Mamdani, teaches political science at Columbia and heads a policy research institute at Makerere University in Uganda, so she splits her time between New York and Kampala, the Ugandan capital, while visiting family in India, too.

“The beauty of living in two or three places is your worldview is forced to expand,” she said. “When you live only here, it’s a one-sided conversation with the rest of the world. I wanted to show both sides. Mohsin’s novel gave me the bones to do that.”

Correction: May 5, 2013

An article on April 21 about the new film “The Reluctant Fundamentalist,” based on a novel by Mohsin Hamid, misstated the contribution of Mira Nair. She directed the film; she was not a co-writer of the screenplay, which was written by William Wheeler.