Stand-up comedians routinely talk about working tough crowds, but Ahmed Ahmed’s toughest might have been an audience of one, at a Ramadan dinner he attended last fall at the State Department.

“Hillary Clinton comes in, and I get to meet her,” Ahmed recalls, “and she says, ‘You’re a comedian? You better make me laugh at dinner.’ And she sits down in the seat next to me. I was so shocked. ‘So tell me about these comedy shows you do in the Middle East.’ I told her. She said, ‘You do it in English? And they get it?’ Yeah, I said, they get it. She said, ‘I’d like to see it.’ I said, Funny you should ask, I just happen to have a copy right here.

Like any savvy first-time filmmaker — because you never know when you might meet a studio executive or a secretary of state — Ahmed had his movie in his pocket. “Just Like Us,” a combination comedy revue, travelogue and geopolitical experiment, chronicles a stand-up tour of the Middle East by a troupe of ethnically diverse comedians working some of the tougher venues in the world. Dubai. Beirut. Riyadh. Cairo. Places where the boundaries of humor are dangerously unclear — where the usual sense of peril that accompanies live comedy is ratcheted up by location, religion and the tinderbox of Mideast politics . . . and where people laugh just like they do here.

Which is, of course, the point. Ahmed, who is Egyptian American, says the movie is really “about humor and family and culture. There’s a smidgen of geopolitics and religion just to raise the question, not to preach it. I’m just hoping audiences respond.”

Between skirting propriety and feeling out what works, the comics manage to be mildly offensive (“We invented the mechanical clock,” Ahmed tells a Dubai audience, “which is odd, because we’re late for everything”). And a little more offensive (“An Englishman, an Irishman and Scotsman — in the U.K. that’s a joke,” says Iranian British comic Omid Djalili. “To us, that’s a hostage situation”). And really offensive (in ways that can’t be repeated here).

In the end, Ahmed — who was once banned in Dubai for a year for telling a joke that merely touched on religion — says he hopes to break down cultural barriers and perhaps educate audiences in the West, where the Mideast is often viewed as monolithic.

American audiences will likely be surprised by the regional differences in humor — Egyptians, for instance, are generally considered to be hilarious. Who knew? “I don’t know what it is,” agrees Egyptian American comic Maria Shehata, who is featured in the film. “I’m like the least funny person in my family.”

Getting across in the Mideast, she says, depends on being able to read a room — just as you would anywhere else. But the “Just Like Us” performers also had to contend with very large crowds.

“It throws your timing off,” she says. “The microphone echoes, the laughs come in waves. In a small crowd, your timing has to be quicker. With a huge crowd, it’s a lot like Skype.”

Veteran American comedian Tommy Davidson, also in the film, says much of what happens is about common sense. “For example,” he says, “you go to Saudi Arabia, and it is a heavy-duty Islamic place. The men have women walk eight feet behind them. It’s not like they’re dealing with their sexuality. Talking about sex in a place like that is like walking into a lion cage with a hat made of pork chops. You can do it, but basically it’s not a good idea.”

Ahmed, whose movie opens Friday, will be speaking the following night at the Anti-Arab Discrimination Committee Convention at the Washington Marriott Wardman Park Hotel.

It’s been a “long journey,” he says, for a film that was rejected by 23 film festivals before being accepted at Tribeca (“which is kind of ironic, since that festival came about because of 9/11”). Getting “Just Like Us” across to Americans may be as problematic as doing stand-up in Beirut, but Ahmed says the test screenings they’ve done so far indicate otherwise.

“One of the best moments of my life was after this Nashville screening,” he says. “A 70-year-old Christian pastor came up to me and said, ‘Hey, I just wanted to say I really loved the film, the message was loud and clear. If you could bleep out a couple of the F-bombs in your movie, I’d love to play it in my church.’ ”

Anderson is a freelance writer.

Just Like Us

opens Friday at Landmark’s E Street Cinema and is rated R for language.