Ray Liotta says a bisexual twist for his Shades of Blue character left him doing a double take.

Liotta plays corrupt cop Lieutenant Matt Wozniak on the NBC show which stars Jennifer Lopez as a single mother and a NYPD detective.

On Thursday's episode, False Face, False Heart, Wozniak, who has a wife, meets with Internal Affairs officer Donnie Pomp (played by Michael Esper) in a hotel. The pair share a kiss. Later, Pomp is seen in the background taking a shower as Wozniak places a phone call.

“I read the script and thought, 'This is really good,' and all of a sudden there was this one little scene where this guy comes in and the script says my hand lingers on him a little bit longer, and I said, 'Oh my God, I'm gay in this. I'm bisexual. Holy shit! It knocked my socks off,” Liotta told TV Insider.

Adi Hasak, the show's creator and executive producer, told The Wrap that Liotta's Wozniak is “not defined by being a macho character who's also gay. This is the beginning of unraveling several levels of the psyche of this character.”