the cast of Criminal Minds the cast of Criminal Minds

On Criminal Minds' Glendale, California, soundstage, cast members look far happier than they ever do on the show. A massive cake, spattered with fake blood splotches to commemorate the CBS series' 200th episode, rests before a podium as star Joe Mantegna, who plays Special Agent David Rossi, speaks triumphantly to the actors and crew.

"We're not the media darling of the critics," he declares wryly, "but more people, around the world, pee during our commercials than during all of those media darlings combined."

In fact, Criminal Minds has survived not only critical beatdowns but also sundry casting upheavals, emerging as an enduring, if often disturbing, hit. Charting the FBI Behavioral Analysis Unit's efforts to track down the most demented bad guys and gals before they slay again, it has routinely been Wednesday night's highest-rated show during the last nine seasons.

The show succeeded out of the gate in 2005, but its future was put in jeopardy when star Mandy Patinkin quit abruptly in its third season because of moral objections to the dark material.

"When Mandy left, it was the job of the writers to figure out a story that would explain his departure," recalls executive producer Erica Messer. "It was insane — we pulled some all-nighters — but we didn't slow down production at all. It made our audience love us even more because that happened: One of our team abandoned us, and they're gonna triumph with a man down. And finding Joe was a gift."

After Mantegna saw the episodes shot without Patinkin, "I came away saying, 'This is not a one-trick-pony show — this is an ensemble,'" he says. "They just lost their left fielder. All I need to do is play left field. These guys were already killing it. I realized then this could run forever."

In 2010, producers were forced to cut cast members to save money, resulting in the departures of A.J. Cook (JJ Jareau) and Paget Brewster (Emily Prentiss). Cook says she discovered she got axed "while I was on vacation on Barbados. I got really drunk."

Fan response, however, was swift and vociferous, and both soon rejoined the cast (Brewster has since exited again). "The reaction when we were ousted was awesome, and the reaction when we came back was awesome," Cook marvels. "Not a day goes by where I don't think, 'We're lucky.'"

"We lost a battle we didn't even know we were fighting, and it recharged everyone," Messer notes, adding that the 200th episode deals with what happened to Jareau ­between her departure (she was ­re­assigned to the Pentagon) and her return. She disappears in this landmark episode, and Prentiss temporarily comes back to help ­locate her. Messer, emboldened by its ­enduring success, declares that the show "has got 200 more episodes in it."

At the celebration, crew members enjoy flutes of apple cider masquerading as champagne, and then they return to help the BAU prevent yet another ghastly murder. The cake remains without a slice taken out of it. Maybe those blood stains weren't so appetizing.

Criminal Minds airs Wednesdays at 9/8c on CBS.

Subscribe to TV Guide Magazine now!