NEW YORK (AP) — Viewers tuning in to Thursday’s episode of “Candy,” starring Jessica Biel, may recognize a familiar face: Biel’s husband Justin Timberlake.

More News from WRBL

The musician and actor portrays a deputy who investigates the murder the show is centered around.

Biel, a co-executive producer on the project, says Timberlake first approached her producing partner, Michelle Purple, about wanting to be involved.

“They sort of had this whole plan. I didn’t even know about at first. And then I thought he was kidding. And then he said, ‘No, for real, I want to do this.’ And then it was off to the races. He was getting a wig fitting, it was so fun and was such a good surprise.”

Biel admits to being worried at first about whether their dynamic would “translate at work” but that quickly went away.

“I actually felt total peace when he was around. Like, I knew he was going to hold that sort of safe space for me to work in the way I needed to and be non-judgmental and open and free. And he gave me the freedom to improvise, which he’s so good at and I’m less comfortable with.”

In “Candy,” Biel plays Candy Montgomery, a young, outgoing, church-going wife and mother in Texas who voraciously reads romance novels. She seems to have it all — but is bored — so she begins an affair with a man from her town (played by Pablo Schreiber) and ends up killing his wife, Betty, with an ax. Montgomery pleaded not guilty to the crime and a jury sided with her, some even saying they never liked Betty.

The story is based on a real case from 1980 and is of interest in Hollywood at the moment. Elizabeth Olsen recently wrapped filming her own limited series version called “Love and Death,” in which she plays Candy.

Melanie Lynskey, who plays Betty, hopes the story will lead to compassion for the victim, and that people will see how the trial was a popularity contest.

“As somebody who has had a hard time fitting in for a lot of my life since I was a little girl, I really, really responded to that and just how deeply unfair it was,” she said.

Timberlake isn’t the only surprise casting in the show: Lynskey’s husband, Jason Ritter, plays Timberlake’s partner. A memorable moment is when the two recreate the crime as part of their investigation.

Biel credits “Candy” co-creator and showrunner Robin Veith for “the idea to have Jason as well and have these two be partners in crime. It tickled us,” said Biel.

Biel wears a wig with short, curly brown hair in the series which has gotten a lot of attention. She jokes that it’s a similar hairstyle to one her husband had in the late 90s with his boy band NSYNC.

“He definitely had that hairstyle,” said Biel. I always ask, “Please grow those beautiful curls back out. I love that curly hair. I know. It’s so weird. We were laughing about that.”