Stephanie Beatriz was preparing for her second-round audition for "Brooklyn Nine-Nine" when she heard that another Latina actress, Melissa Fumero, had won a role in the Fox sitcom. Beatriz's heart sank.

"I thought, 'That's it. The network is not going to allow there to be two Latinas in one show,'" Beatriz said. "I was so used to, 'There's only room for one.'"

Beatriz was wrong. The "Brooklyn Nine-Nine" cast includes both of the actresses, along with two African-Americans and five whites.

Making sure "Brooklyn Nine-Nine" reflected the melting-pot world it's drawn from was key for Daniel J. Goor and Michael Schur. The veteran writers and producers, whose credits include "Parks and Recreation," were mulling a joint project when they quickly settled on a New York-based police comedy.

"Police deal with people of all types: races, genders, sexualities, which allows for an unbelievable number of stories," Goor said. "And when you look at the NYPD itself, it's an incredibly diverse police force."

More On This...

Added Schur: "It seemed like the more diverse, interesting-looking group of people you had, the more fun the show would be."

The payoff for "Brooklyn Nine-Nine" so far includes a 2014 Golden Globe best comedy series trophy and solid ratings that earned it a sophomore season.

Diversity also provided more than a wealth of lively material for the show's nine-member writing staff, which includes black, Indian-American and gay writers, along with Goor and Schur, both of whom are white.

"From a practical point, it meant we could open up the casting process really to anyone, which is a tremendous advantage," Goor said. "We could say to the casting director (Allison Jones), we want to have two male cops and two female cops of this age, and we can audition anyone."

Word of Andy Samberg's decision to leave "Saturday Night Live" came after Goor and Schur had a deal in place with Fox, and they pursued him for the role of freewheeling police Detective Jake Peralta.

Terry Crews, the NFL player turned actor, was hired shortly after to play Sgt. Terry Jeffords. Crews' audition was so impressive that "we came up with a character named Terry, which was really a bad negotiating tactic," Goor joked.

Andre Braugher was brought on as stern precinct Capt. Ray Holt, a move notable for the multiple Emmy Award-winning actor's shift from drama to comedy. Tough black bosses are a TV staple, often limited to nothing more than barking orders, but Holt's personal life comes into play on "Brooklyn Nine-Nine" and Braugher is far from marginalized.

Other top roles went to Joe Lo Truglio, Dirk Blocker and Joel McKinnon Miller as, respectively, white detectives Boyle, Hitchcock and Scully, and Chelsea Peretti as an administrator and assistant to Holt.

Then came a rare move for a network series, with two of the three major female roles going to Fumero (Detective Amy Santiago) and Beatriz (Detective Rosa Diaz).

"Again, we were searching for the best (people)," Goor said.

Added Schur: "When we told the network of our choices, the reaction was, 'That's good, let's move on.'"

Painting the world of such a police department as "having all white faces would be ridiculous," said Dana Walden, chairman and CEO of the Fox Television Group.

Beatriz considers the fact that she and Fumero were cast together to be "incredible," adding that the two "still look at each other sometimes and go, 'This is crazy!'"

The actors not only measure up to their real-life NYPD counterparts, part of a force that's more than half minority officers: They have been recognized by their industry peers with a 2015 Screen Actors Guild Award nomination for best TV comedy ensemble.

While none of the show's characters is window dressing, they also are not treated as fodder for jokes or stereotypes about race or, in the case of the gay Holt, sexual orientation, Goor and Schur said.

When he considers his own colleagues, Goor said, the basis for their contributions to the workplace "isn't their background. It's an influence of it, but it's not the starting point of every sentence they say or every thought they have. That's what I like about how we write Capt. Holt: He wants to have the best precinct there is. That's his goal and where he comes from."

And that's where producers aim to start and end as well, making Holt — as with the other characters — a man who's the sum of all his parts.

"You don't reduce people to one thing in the modern age. That's our No. 1 rule of writing," Schur said.

Like us on Facebook
Follow us on Twitter & Instagram