By Mike Hale

New York Times News Service

NEW YORK — The tall, attractive, very funny woman across the table was a hit at Sundance this year with her first feature film, the comedy “Appropriate Behavior,” and then she was summoned by Lena Dunham to join the cast of “Girls” next season. At 29, she’s having, or is about to have, or maybe can look forward to, a moment. But Desiree Akhavan wants you to know there were some rough spots on the way.

There was the New Jersey middle-school production of “The Lion, the Witch and the Wardrobe” when she wanted to be the witch and was cast as the lion. (“I thought, ‘OK, there might be a reason I’m not the hot one.’ ”) There were the years of not fitting in at Smith College, where she tried out for play after play and was cast in just one, the Virgil Thomson-Gertrude Stein opera “The Mother of Us All.” As Thomson. (“I can’t think of anything I’d be less connected to than that. I’m looking for polite wording right now.”) As a writer and director, there was the undergraduate short film (“Really bad. Just the worst. Somewhere in my parents’ basement”) and the film-school short film (“It really bombed.”).

But for all-around wretchedness, one story is hard to beat.

“At 14, I was voted the ugliest person at Horace Mann,” she says, referring to her high school years at the prep school in the Bronx. “There was a contest. And I won it.”

You tell her that’s a little hard to believe (“Oh thank you! But no, I was kind of an ugly kid.”) at the same time that you see where the penchant for extreme, sardonic self-deprecation might have come from.

“I was the beast,” she says, during an interview at a vegan Upper West Side cafe. “That was what they called me. It’s something you don’t let go of. But for me, it became a drive.”

That drive eventually resulted in a successful Web series, “The Slope,” made with her girlfriend at the time, about being slacker lesbians in Park Slope, Brooklyn. The Web series helped her get backing for “Appropriate Behavior,” her “winning first feature” (A.O. Scott, The New York Times) about Shirin, a needy, confused Brooklynite coming off a bad breakup who behaves inappropriately (sometimes quite explicitly so) in nearly every situation.

Akhavan wrote and directed the film and plays Shirin, with whom she has certain superficial similarities: They’re both bisexual, Iranian-American 20-somethings. From there the two diverge. While “Appropriate Behavior” travels the festival circuit Akhavan is embarking on something new: For the first time as an adult, she’s acting in someone else’s production.

In February, just as she was going through “Girls” withdrawal after that HBO show’s Season 3 finale, she received “the most exciting email of my life” from Dunham’s production company asking for a link to her film. Soon, she was in Los Angeles in a get-to-know-you meeting with Dunham, her fellow auteur of the awkward outsider, and other producers.

A few months later came an unexpected follow-up: an invitation to a “Girls” table reading, where she would be doing a part written with her in mind.

After the reading, she was offered the role, as a classmate of Dunham’s character, Hannah, at the Iowa Writers’ Workshop.

She can only say so much about her character before Season 4 begins next year. “It’s clear that I’m ethnic,” she says, “and that I come from a background of honor killings — oh no, no, that might get cut. But there’s no real indicator as to whether I’m gay, whether I’m Iranian, which is fun.”

Marcie Bianco, who teaches literature at Hunter and John Jay Colleges and contributed an essay to “HBO’s ‘Girls’: Questions of Gender, Politics and Millennial Angst,” said: “I love the addition of Desiree to the show, because I feel like both she and Dunham are pushing boundaries of genre and boundaries of morality. I’m hoping that, as with Shirin in ‘Appropriate Behavior,’ she’ll have that same dry, immodest but also modest sensibility about her.”

For her part, Akhavan is quick to play down any suggestion that she is pursuing an agenda in her work as writer, director or performer.

“I see where the funny lies and where the story is, and I chase the story wherever it leads me,” she says. “And it usually leads to a very personal place and my life just happens to involve all these hugely political things — being bisexual, being Iranian and now being a woman is inherently political, too. But I don’t consider those things at all while I’m doing it.”