Suzanne Hanover/Universal Studios

Kristen Wiig scores in an erratic gross comedy that connects where it counts.

The raunchy/goofy opening sex scene between Kristen Wiig and Jon Hamm leads you to the immediate assumption that Bridesmaids will be serving up a mature female twist on the typical Judd Apatow production of a few years ago. But while there is plenty of sex-oriented humor to follow (some of which feels awkwardly forced), what you get is a human comedy with empathetic appeal and a disarmingly candid take on feminine foibles.

For longtime Wiig fans, this uneven, overlong, emotionally involving and discreetly ambitious film will represent a welcome and overdue step up from her popular sketch work on Saturday Night Live to something sustained and searching, not to mention pretty funny. Although titled and decked out like a chick flick, this is a picture that can reach both sexes but won't appeal much to teenagers, giving Universal a tricky but not insurmountable marketing challenge.

An almost-beautiful woman in her late 30s without a dime, a relationship or a car built in this century, Annie (Wiig) insists more than once that she's hit rock bottom. This, she's told by her mother (the late Jill Clayburgh), means there's no direction she can go except up, but Annie discovers there's always another, deeper level of Earthly hell. As obviously bright as Annie is, it's hard to figure why she's such a loser, but it becomes clear Annie is her own worst enemy -- that she visits the vast majority of her ill-fortune upon herself.

The device Wiig and her co-writer Annie Mumolo use to delineate the character's continual decline and fall is the act of being a bridesmaid. Unlike being a best man, many guys will be interested to learn (or not) that this does not simply entail the equivalent of getting the groom plastered at the bachelor party and remembering to bring the ring to the ceremony. No, this is where the boilerplate chick-flick trappings assert themselves: There are outings for dresses and fittings, girly lunches, the bachelorette trip, bridal shower, talks on the phone and so much else that has become the bane of audiences who might not be in the precise demographic category for this sort of vicarious wish-fulfillment fantasy.

As the lifelong best friend of Lillian (Maya Rudolph), Annie rightly assumes she will be maid of honor at the nuptials. But she soon gets into a pissing match with Lillian's newly found pal, the rich Helen (Rose Byrne), who strips Annie of any influence with Lillian. Finding ever-more-novel ways to shoot herself in the foot, Annie also manages to blow it with the man she is obviously meant to be with, Rhodes (Chris O'Dowd), a somewhat oafish cop with a curious Irish accent (they're in Milwaukee, after all) whose crucial gift is an offbeat sense of humor that perfectly complements Annie's.

Some of the obstacles that befall Annie feel contrived, notably the off-the-wall British brother and sister (Matt Lucas, Rebel Wilson) Annie unaccountably lives with. Two of the bridesmaids, Rita (Wendi McLendon-Covey) and Becca (Ellie Kemper), are not as well developed as the others, and the humor gets pretty rank when a case of food poisoning at a Brazilian restaurant results in the bridesmaids losing their lunches in both conceivable ways all over and outside a swank dress shop.

Director Paul Feig doesn't maintain an entirely consistent tone, nor has he been able to shape or pace the script with the sort of assurance that inspires confidence in his absolute control over every aspect of the enterprise. Some scenes just rattle on and, as happens more often than not with Apatow-produced fare, the film is at least 15 minutes too long.

But it's hard not to connect strongly with Annie, nor to come away with the feeling that behind the laughs both crude and clever doesn't lie an uncannily vivid portrait of the self-destructive impulse. Annie has enough going for her -- looks, smarts, wit and an affability she spoils only with an unchecked honesty -- that she should be able to make out fine personally and professionally. That she can't presents the occasion for no small measure of humor as well as for a distinctive comic character study in which Wiig excels. There's none of the usual clichéd hand-wringing, sentimentality or self-pity about wanting a baby or getting old, just passing insights into self-delusion, behavior patterns and perennial excuses for not getting it together.

It remains to be seen whether Wiig is too specialized a taste for masses to embrace, but she's good here, real good. Byrne is spot-on as the haughty but needy instigator of her downfall, while many of the choice lines are owned by Melissa McCarthy as the large-format Megan, an assertive woman rarely at a loss for words. It's good to see Clayburgh one last time, though her voice isn't strong, and Hamm gets to spend the majority of his screen time making out with Wiig.

Release date Friday, May 13 (Universal)
Cast Kristin Wiig, Maya Rudolph, Rose Byrne, Chris O'Dowd, Melissa McCarthy, Wendi McLendon-Covey, Ellie Kemper, Jill Clayburgh, Jon Hamm
Director Paul Feig
Producers Judd Apatow, Barry Mendel, Clayton Townsend
Rated R, 125 minutes