Brooklyn Nine-Nine Eva Longoria (left) will guest star as a defense attorney named Sophia when episode 6 of "Brooklyn Nine-Nine" airs on Sunday, Nov. 9. Photo: Fox

Jake Peralta (Andy Samberg) is “Brooklyn Nine-Nine’s” most beloved detective -- or so he’d like to think. But, what happens when he does something that could affect his relationship with the rest of the precinct?

Viewers will find out during episode 2 on Sunday, Nov. 9, when Peralta accidentally gets romantically involved with a defense attorney named Sophia, played by guest star Eva Longoria. According to Entertainment Weekly, the two meet and hit it off at a bar. Soon after, Jake discovers that Sophia is a defense attorney. Not only is it her job to undo all of the Nine-Nine’s police work, she's also defending someone Peralta personally arrested.

“Jake meets his match with Sophia -- she’s a whip-smart lawyer who some people might possibly consider to be attractive,” executive producer Dan Goor told EW. “There is sexual tension between the two characters, but there is also the reality that cops and defense attorneys hate each other. The question is: Will Jake sleep with the enemy?”

It’s unclear what a new love interest means for Jake’s ongoing crush on Amy Santiago (Melissa Fumero). Fans will note that his unrequited feelings for her have been a major plot point since the end of the show’s first season. Santiago revealed on last week’s episode that her relationship isn’t going well (weird mesh underwear?), so maybe a new love interest is just the shot in the arm Peralta needs to show Santiago what she’s missing.

Then again, perhaps the show has other plans for Santiago. TV Guide reports that episode 6 will end with “two very unexpected people together in a romantic hotel suite with a bottle of bubbly.”

Could this mean Santiago is destined for a different relationship? Will Boyle (Joe Lo Truglio) finally get his shot with Rosa (Stephanie Beatriz)? Maybe Gina (Chelsea Peretti) will use her relationship with Boyle as a springboard to a new downward spiral of bad hookups. Then again, it could all just be some big high-jinks-fueled misunderstanding. Fans will simply have to tune into “Brooklyn Nine-Nine” Sunday on Fox at 8:30 p.m. EST to find out. In the meantime, they can check out the episode preview below.