When the women of Bridesmaids board a plane bound for a bachelorette party in Vegas, it’s easy to assume that’s where the movie’s really going to get crazy. By this point in the narrative, the characters in this group have already been established as an idiosyncratic and wide-ranging set of personalities. Rather than making them a band of lifelong friends, writers Kristen Wiig and Annie Mumolo choose to make them strangers, only bonded by their independent friendships with the bride-to-be, Lillian (Maya Rudolph). The personality clashes and getting-to-know-you moments provide the basis for a lot of the initial comedy within that group dynamic; as the flight takes off for Sin City, the possibilities for disastrous hilarity seem set.

There’s a disaster in store for this trip, but not any of the ones you’re expecting. This is a sharp comedy, packed with riotously funny material. But it’s the way that Wiig and Mumolo subvert expectations — both in the Vegas sequence, and throughout the movie — that makes it such an engaging story, and not just a collection of funny incidents.

In addition to being Wiig’s first film as writer, it’s also her first lead role, and after watching, I can only wonder why it took so long for Hollywood to give her a film to carry. She’s magnificently funny and unselfconsciously flawed as Annie, Lillian’s best friend and maid of honor — a woman who, at the film’s start, is nearing the tail end of a particularly deep downward spiral of personal and professional disasters. Her small business went under. Her boyfriend left her. She’s renting a room from a profoundly creepy and invasive British brother and sister. She’s working a job she hates at a jewelry store, hired on there as a favor by her mom’s friend in Alcoholics Anonymous. To top it off, she’s in a purely sexual relationship with the rich, self-centered, thoroughly awful Ted (Jon Hamm, once again showing off the comedic talents that Mad Men doesn’t allow him to tap), who she simultaneously hates yet craves affection from.

The one bright spot in her life is her longtime, rock-solid friendship with Lillian. But Annie’s selection as maid of honor thrusts her into a role of heavy responsibility at a time in her life when she’s barely able to keep herself afloat, let alone her best friend’s wedding. And Lillian’s friend Helen (Rose Byrne), a wealthy, perpetually sunny high-society type, is only too willing to step in and take things over, and that includes not just Annie’s wedding responsibilities, but also her place as Lillian’s closest friend.

It would be easy to place this into a box as simply a female-centric version of the standard Judd Apatow comedy. After all, it does have the rambling, raunchy quality of an Apatow film, and he serves as executive producer. (On that note: can people please stop referring to this as a “Judd Apatow movie”? “Producer” is not an authorial credit, and this movie belongs to Wiig, Mumolo, and director Paul Feig far more than Apatow.) One could just as easily write it off as an attempt to cash in on the success of The Hangover, only this time for the ladies. The latter comparison is most unfair, because Bridesmaids, chaotic and wild as the comedy often is, keeps itself grounded in plausible realities far more than that film. Even when it does push the envelope — Wiig and Mumolo’s script makes a hilariously uncomfortable point of trying to up the ante on the gross-out factor of male-dominated comedies in a sequence involving food poisoning and a high-end dress fitting — it rarely feels bizarre for the sake of being bizarre.

As for the Apatow comparisons, Bridesmaids‘ biggest strengths lie exactly where Apatow’s weaknesses do. Where his movies tend to feature inoffensive but somewhat one-dimensional female characters, the women of this film are complex, unique and fully-formed. Annie, Lillian, and Helen are the main focus, but Wiig and Mumolo do efficient work giving each of these women depth even when some of them have limited camera time. And despite being a film about women, the primary male character is strongly written as well. The sensitive, somewhat goofy cop Rhodes (Chris O’Dowd) does enter as a love interest for Annie, but their success or failure isn’t central to the story: the friendship between the women is.

That’s what gives Bridesmaids a heart as big as its laughs: its attention to the details and realities of maintaining long term friendships, with special attention to the specifics of friendship between women. (But not, it should be noted, in any way that would preclude any man with a genuine interest in women from finding it just as funny and poignant.) Unlike what Sex and the City became when it hit the big screen, where those friendships somehow were mostly about shopping, world travel, and lives that ended up feeling like they were more about the men in them than each other, Bridesmaids doesn’t resort to cheap stereotypes and weepy saccharine resolutions, all carried out in a fabulous pair of Manolo Blahniks.

The friendships here are messy, and sometimes things break so badly you’re not entirely sure they can be fixed. Sometimes, you have to laugh loudly and inappropriately to make it through: and inappropriate laughs are something this film has in such large supply that you’ll probably want to see it a second time to catch all the jokes you missed while laughing at the one before.

Bridesmaids
Directed by Paul Feig
Written by Kristen Wiig & Annie Mumolo
Starring Kristen Wiig, Maya Rudolph, Rose Byrne, Chris O’Dowd,
Running time: 125 minutes
Rated R for some strong sexuality, and language throughout.
Opens today at theaters throughout the area.

Follow this author on Twitter.