Michael Douglas’ troubled son Cameron has been quietly released from jail after nearly seven years — and is planning to write a tell-all book about his descent from the privileged scion of a Hollywood dynasty to a solitary-confinement jail cell.

The “Wall Street” star’s eldest son Cameron, 37, was sentenced to five years for possessing heroin and selling drugs including methamphetamine in 2010, but his term was extended after he confessed to smuggling drugs into prison. He was placed in solitary confinement from 2012 to 2014 at Maryland’s Cumberland Federal Corrections Institute. He had been scheduled for release in early 2018 and is now living in a halfway house.

Michael, who had Cameron with ex-wife Diandra, had said of his son’s jail term, which began at the same time the actor was battling throat cancer, “It broke my heart, the combination [of my diagnosis and Cameron’s incarceration].”

Michael regularly visited his son in jail. And during his 2013 Emmys acceptance speech for playing Liberace in “Behind the Candelabra,” Michael talked about the brutality of the prison system. He said: “I’m questioning the system. At first I was certainly disappointed with my son, but I’ve reached a point now where I’m disappointed with the system . . . If you happen to have a slip, they punish you. In my son’s case, he has spent almost two years in solitary confinement.” He added he had hoped then-Attorney General Eric Holder might change laws involving nonviolent drug offenders.

Now we’re told Cameron wants to write a book about his experience behind bars. A source said, “Cameron will talk about his struggle being the son and grandson of Hollywood icons, and then his bad decisions which led him to jail, and then solitary confinement. He is staying low-key after his release and plans to spend time with his father and mother. He believes this is a new start, and a chance at a new life.”

Reps for Michael and Diandra didn’t get back to us Sunday night.

This article originally appeared in the New York Post's Page Six.