Kyra Sedgwick has just closed a deal to return to TV: She will guest-star in two episodes of Brooklyn Nine-Nine this season, EW has learned.

Sedgwick, whose seven-season run on The Closer ended in 2012, will play a different kind of deputy chief—Madeline Wuntch, the steely longtime rival of Captain Holt (Andre Braugher, who received an Emmy nomination earlier this month). Now in a higher-ranking position than Holt, Deputy Chief Wuntch is evaluating all of the precincts, and she’s aiming to take him down—along with the rest of the Nine-Nine.