Eva Longoria has been tapped to guest star in a three-episode arc in the second season of “Brooklyn Nine-Nine.”

Longoria will play Sophia, a defense attorney who battles Jake (Andy Samberg) in court, catching his eye in the process. She joins other confirmed guest stars for the Fox comedy’s upcoming season, including Kyra Sedgwick, Terrell Owens and Jenny Slate.

“Brooklyn Nine-Nine’s” second season will see dramatic changes from its season one plotlines. It will follow cliffhangers during season one’s finale that involve Jake’s admittance of his feelings for detective Amy Santiago (Melissa Fumero) and Jake’s new assignment to go undercover for an FBI investigation.

Known for her Golden Globe-nominated role in “Desperate Housewives,” Longoria stars in the border film “Frontera,” which will receive U.S. distribution by Magnolia Pictures in 2014. She also exec produced the Screen Media farm worker documentary “Food Chains” and the Lifetime series “Devious Maids.”

“Brooklyn Nine-Nine” will premiere at 8:30 p.m. Sept. 28 on Fox.