Michael Douglas reveals he had a torrid affair with one of his co-stars while filming “Basic Instinct.”

In the 1992 erotic thriller, the actor portrayed a homicide detective who struck up a sizzling relationship with the prime suspect — a wealthy heiress played by Sharon Stone — while investigating a murder.

The steamy sex scenes in the movie were a sensation at the time, leading to speculation that the two were having an affair in real life.

Douglas is finally setting the record straight, however, revealing in his new memoir, “One Helluva Ride,” that he was actually seeing another co-star: Jeanne Tripplehorn, who played his therapist.

Michael Douglas revealed he had an affair with Jeanne Tripplehorn on the set of the 1992 thriller “Basic Instinct.” ©TriStar Pictures/Courtesy Everett Collection

At the time of the film’s release, many assumed that Douglas was having an affair with another female co-star, Sharon Stone, due to their steamy scenes together (as seen above). ©TriStar Pictures/Courtesy Everett Collection

“The truth is, I fell very hard for Jeanne despite our nearly 20-year age difference,” the Oscar winner —who was married to his first wife, Diandra Luker, at the time — admits in his tome.

“In fact, I was ready to officially leave my wife for Jeanne. I was crazy about her.”

The “Fatal Attraction” star noted, however, that he knew ditching nearly two decades of marriage and jumping right into another serious relationship would be the “worst thing” for him.

Tripplehorn played Douglas’ therapist in the erotic thriller (as seen above in scenes from the film). Everett Collection / Everett Col

“I fell very hard for Jeanne despite our nearly 20-year age difference,” Douglas admits in his book. ©TriStar Pictures/Courtesy Everett Collection

“My relationship with Jeanne lasted through production, then we went our separate ways,” he recalls.

“But I will always think of her as an amazing actress and a truly terrific woman that I was very fortunate to spend time with.”

Douglas, now 82, eventually divorced Luker. He’s been married to Catherine Zeta-Jones, 57, since 2000.

Want more celebrity and pop culture news?

Start your day with Page Six Daily.

Thanks for signing up!

The trio promoted the movie at the Cannes Film Festival in 1992, but the affair had ended by then. Gamma-Rapho via Getty Images

The Oscar winner’s new memoir, out now, is titled “One Helluva Ride.” Grand Central Publishing via AP

Meanwhile, Triplehorn, now 63, married actor Leland Orser, 66, in 2000.

A spokesperson for the “Big Love” alum did not respond to Page Six’s request for comment.

“One Helluva Ride” is out now.