Turkish police seized all copies of a book by jailed politician Ekrem Imamoglu in late August. The court banned the work, titled "The Nation is My Witness," before it reached shelves. Imamoglu wrote, "Do you know the real reason for the attempt to destroy the opposition? It is to."

From jail, the former mayor of Istanbul accuses President Recep Tayyip Erdogan of hollowing out Turkey's democracy to stay in power.

The book was being printed in late August, just days before its scheduled publication date in Turkey. Then the police showed up, stopped the presses and seized all copies, according to court documents.

The next day, a court officially banned the book, by a jailed opposition leader who had vowed to challenge President Recep Tayyip Erdogan in Turkey's next presidential election.

It never hit the shelves, meaning that very few people have read it. But The New York Times obtained a copy to try to understand why a work by one of Turkey's best-known politicians was banned and what that says about the state of the country's democracy.

The banning of the book, "The Nation is My Witness," by the former Istanbul mayor Ekrem Imamoglu, came nearly two years into a crackdown that has seen scores of officials and members of Turkey's political opposition arrested, mostly on corruption-related charges. Many remain in jail, and a number of mayors, including Mr. Imamoglu, have been removed from office.

In May, a court ousted the leadership of the Republican People's Party, then Turkey's largest opposition party, and reinstated its previous chairman, the man Mr. Erdogan defeated in Turkey's 2023 presidential election. Many party members defected to a competing party, the New Party, dividing the opposition.

The government has barred critical social media accounts (including one that tracks blocked accounts). Last week, a court blocked the website and social media accounts of T24, an independent news outlet, deeming some of its coverage "L.G.B.T. propaganda." (The outlet's mobile app still works.)

Mr. Erdogan has been Turkey's predominant politician for more than two decades, and his current terms ends in May 2028. But an early election is widely expected next year, which would allow him to seek another five-year term. He has not said whether he intends to run, but few doubt that he will.

It remains unclear who will represent the opposition.

Mr. Imamoglu faces an array of cases on charges including corruption, insulting public officials and espionage. He has denied all wrongdoing, and he and his supporters accuse Mr. Erdogan and his government of weaponizing the law to weaken their challengers.

"Do you know the real reason for the attempt to destroy the opposition?" Mr. Imamoglu wrote in his book. "It is to make the one-man regime permanent. The government knows this well: if there are fair elections, they will lose."

Turkish officials insist that the country's legal system is independent. Mr. Erdogan has portrayed the opposition as so corrupt that its illegal schemes extend like "the arms of an octopus." Turkey's Justice Ministry and the Turkish presidency's Directorate of Communications did not respond to requests for comment.

Mr. Imamoglu's book is a text version of the court defense he prepared -- but never got to deliver -- in a case accusing him of overseeing a criminal conspiracy inside Istanbul's City Hall to enrich himself and fund his political ambitions. Prosecutors are seeking a prison sentence of more than 2,000 years.

Hoping to make his case directly to Turkish voters, Mr. Imamoglu found a publisher, who planned to print 22,000 copies and put them on sale on Aug. 30.

A few days before they went to market, prosecutors asked a court to block the book's distribution, citing passages they said were "degrading and humiliating to the President, the judiciary, the government and public officials," according to court documents.

On Aug. 27, the court banned the book "to ensure public order and prevent any crimes from being committed," writing that the book's content could increase tensions in society.

The Times's reading of Mr. Imamoglu's book found a work that feels like a long campaign speech -- a political manifesto with a hint of legal defense.

While he praises supporters who protested in large numbers after his arrest, he makes no direct calls to action, instead urging people to vote and stand up for democracy and the Constitution.

His criticism of Mr. Erdogan and his government are unflinching, and he accuses them of abusing their authority to remain in power, endangering Turkish democracy.

"The issue is whether the ballot box you put in front of the people is real or fake," he writes. "It is whether the elections are real or a sham, whether the multiparty system is real or a sham."

Elsewhere, he accuses Mr. Erdogan of trying to "hollow out democracy and revoke, in practice, the authority of the nation to change the government."

He addresses some of the legal charges against him, explaining, for example, why a method of municipal accounting his administration used was not corrupt. He also seeks to turn the accusations around, asserting that Mr. Erdogan is corrupt.

He offers a vision of what Turkey would be like with him in charge, including respect for democratic norms, more women in senior roles and greater judicial independence.

The book is not heavy on legal argument because Mr. Imamoglu views his prosecution as politically motivated, one of his former advisers, Serkan Ozcan, said in an interview.

"He said, 'I'm an elected politician, I'm the mayor of Istanbul and I'm a presidential candidate, so my defense should be political,'" Mr. Ozcan said.

Mr. Ozcan called the book banning "a change of standards of democracy" driven by concern about Mr. Imamoglu's political potential.

"It is Imamoglu they are afraid of," he said. "They don't want him to talk. They don't want him to show himself. They don't want him to do politics."

Mr. Imamoglu was scheduled to present his defense in court in July, while NATO leaders were meeting in the Turkish capital, Ankara, drawing the news media's attention elsewhere.

The judges allotted him less than two days to give his defense against an indictment that stretched to nearly 4,000 pages. Mr. Imamoglu objected and, after an argument, the chief judge ordered his removal from the courtroom and ruled that he had declined to offer a defense.

It remains unclear whether Mr. Imamoglu will find another publisher.