On Tuesday night, Brooklyn Nine-Nine steered away from its typical over-the-top antics for something a bit more serious.

In season four's 16th episode, titled "Moo Moo," the show tackled the important topic of racial profiling in one of its most powerful episodes yet. The Fox series is one of the most progressive comedies on TV, and its latest episode proved that once again.

In Tuesday night's installment, Sgt. Terry Jeffords, played by Terry Crews, is the victim of racial profiling by another police officer. The incident weighs on him, and he wants to seek justice. The episode looks at how he and the entire B99 crew handles the issue.

Though Jeffords wants to file a complaint against the other cop, he meets some opposition from his team. Captain Holt, played by Andre Braugher, tells Terry he shouldn't pursue anything because it could hurt his career.

"Moo Moo" was crafted by Emmy nominee Phil Augusta Jackson, who told Yahoo TV he found it challenging to write the script. The show is typically a positive and often silly representation of cops, so to showcase this real-life issue was difficult, Jackson said.

So I think the trick was generating a premise that deals with police brutality and racism, and still, at the core, making it about a dynamic between our characters. I think what unlocked it was how to deal with the incident — that became the key, as opposed to making it solely about the incident itself.

Jackson also revealed the writers had more than 20 versions of the episode. What aired on Tuesday was inspired by Crews and Braugher's conversations about how to handle the event.

Crews had talked to the show's writers and creators about the idea at the beginning of the season, and Braugher was the one who decided Holt would respond the way he did. "So the main conflict that ended up fueling the entire episode was largely a breakthrough that came straight from Andre Braugher," Jackson explained.