NEW YORK — In a memoir released eight months after he died in prison, Russian opposition leader Alexei Navalny never loses faith that his cause is worth suffering for while also acknowledging he wished he could have written a very different book.

“There is a mishmash of bits and pieces, a traditional narrative followed by a prison diary,” Navalny writes in “Patriot,” which was published Tuesday, and is, indeed, a traditional narrative followed by a prison diary.

“I so much do not want my book to be yet another prison diary,” he wrote. “Personally I find them interesting to read, but as a genre — enough is surely enough.”

The final 200 pages of Navalny’s 479-page book do, in some ways, have the characteristics of other prison diaries or of such classic Russian literature as Alexander Solzhenitsyn’s “One Day in the Life of Ivan Denisovich.”

Navalny tracks the boredom, isolation, exhaustion, suffering and absurdity of prison life, while working in asides about everything from 19th-century French literature to Billie Eilish. But “Patriot” also reads as a testament to a dissident’s extraordinary battle against despair as the Russian authorities gradually increase their crackdown against him, and even shares advice on how to confront the worst and still not lose hope.

“The important thing is not to torment yourself with anger, hatred, fantasies of revenge, but to move instantly to acceptance. That can be hard,” he writes. “The process going on in your head is by no means straightforward, but if you find yourself in a bad situation, you should try this. It works, as long as you think everything through seriously.”

In recent years, Navalny had become an international symbol of resistance. A lawyer by training, he started out as an anti-corruption campaigner, but soon turned into a politician with aspirations for public office and eventually became the main challenger to Russia’s longtime president, Vladimir Putin.

Navalny’s widow, Yulia Navalnaya, oversaw the book’s completion and has vowed to continue her late husband’s fight. She had two children with her husband, who in his book writes of his immediate attraction to her and their enduring bond, praising Navalnaya as a soulmate who “could discuss the most difficult matters with me without a lot of drama and hand-wringing.”

During the first section of his book, Navalny reflects on the fall of the Soviet Union, his disenchantment with 1990s Russian leader Boris Yeltsin, his early crusades against corruption and his entry into public life.

His vision of a “beautiful Russia of the future,” where leaders are fairly elected, official corruption is tamed, and democratic institutions work — as well as his strong charisma and sardonic humor — earned him widespread support across the country’s 11 time zones.

The authorities responded to Navalny’s growing popularity by levying multiple charges against him, his allies and even family members. They jailed him often and shut down his political infrastructure — the Foundation for Fighting Corruption he started in 2011 and a network of several dozen regional offices.

In 2020, Navalny survived a nerve agent poisoning he blamed on the Kremlin, which denied involvement. He describes it in great detail in the very beginning of the book, recounting, “This is too much, and I’m about to die.”

His family and allies fought for him to be airlifted to Germany for treatment, and after recovering there for five months, he returned to Russia, only to be arrested and sent to prison, where he would spend the last three years of his life.

In the memoir, Navalny recalls telling his wife while hospitalized in Berlin that “of course” he will go back to Russia.

The pressure on him continued behind bars, intensifying after Russia invaded Ukraine in February 2022 and ratcheted its clampdown on dissent to unprecedented levels.

In messages he was able to get out of prison, Navalny described harrowing conditions of solitary confinement — in which he was placed for months on end for various minor infractions prison officials relentlessly accused him of — sleep deprivation, meager diet and lack of medical help. In October 2023, three of his lawyers were arrested and two more were put on a wanted list.

In December 2023, Navalny was transferred to a penal colony in a remote town above the Arctic Circle. In February 2024, Navalny, 47, died there, the circumstances and the cause of his death a mystery.

Yulia Navalnaya and his allies say the Kremlin killed him, while the authorities argue that Navalny died of “natural causes,” but wouldn’t reveal any details of what happened.

Tens of thousands of Russians attended his funeral on the outskirts of Moscow in March in a rare show of defiance in a country where any street rally or even single pickets often result in arrest and prison.

Navalny’s team has said the book will be available in Russian, the language he wrote it in, but shipping to his homeland and its neighbor Belarus won’t be possible “as we cannot guarantee delivery and the absence of problems at customs.”