Patrick Swayze in an undated publicity photo. REUTERS/File

Actor Patrick Swayze made peace with the notion of dying from pancreatic cancer after initially finding his diagnosis a cruel joke, according to a memoir to be published later this month.

The Dirty Dancing star, 57, who lost his 20-month battle against the disease on Monday, wrote that fighting his cancer had been an emotional rollercoaster.

But in excerpts of the memoir The Time of My Life, released on Wednesday, he wrote later; I began thinking to myself, I've had more lifetimes than any 10 people put together, and it's been an amazing ride. So this is okay.

The book, which Swayze co-wrote with his wife of 34 years, Lisa Niemi, will be published on September 29. Excerpts were released to People magazine and NBC News.

Swayze was diagnosed with pancreatic cancer, which has only a 5 percent, five-year survival rate, in January 2008.

I had been excited about the upswing my life was on, Swayze wrote. Now it all seemed like a cruel joke. I couldn't be dying -- I had too much to live for!

While undergoing chemotherapy, Swayze filmed a new TV police drama series called The Beast, which was broadcast in the United States earlier this year.

There are days when I feel determined to live until a cure is found, and truly believe I can do it, he wrote. And there are days when I'm so tired, I just don't know how I can keep on going.

Atria Books publisher Judith Curr told NBC's Today show that when he sat down to write the book, he wanted to see if he had lived a good life.

He absolutely was a good person and lived a good life, Curr said.

Swayze's storied career included runs on Broadway in the plays Grease and Chicago. He also starred in the 1990 blockbuster Ghost and the 2001 movie Donnie Darko.

No plans have been announced for Swayze's funeral.