Moscow, Russia (CNN) -- Long-time Moscow Mayor Yuri Luzhkov accused President Dmitry Medvedev of leading Russia back into Stalinism a day before he was sacked, a letter in a Russian magazine showed Wednesday.
"Fear to express one's opinion in our country has existed since 1937," Luzhkov wrote to Medvedev, referring to the height of Stalinist repression.
"If the country's leadership is supporting those fears with its own remarks... then it is easy to come to a situation where we have only one leader whose words are carved in stone and who should be followed strictly and unquestionably. How does that correlate with your appeal to 'develop democracy?'" Luzhkov demands in the letter, which was published in The New Times.
Natalya Timakova, a spokeswoman for Medvedev, said Russia's president was not aware of the letter when he decided to fire Luzhkov, and it would not have influenced his decision in any case.
Medvedev fired Luzhkov on Tuesday, saying he has lost confidence in the latter's ability to run the city, the Kremlin said.
Luzhkov had run the sprawling metropolis since 1992. His removal was effective immediately, the Kremlin said, and his first deputy, Vladimir Resin, was appointed acting mayor.
There are more than 20 corruption investigations underway into Moscow officials, a spokesman for investigators said Wednesday, but he said they are not connected to the firing of the mayor.
"They were initiated long before the dismissal of Yuri Luzhkov," Vladimir Markin told the official news agency RIA-Novosti.
The editor of The New Times, Yevgenia Albatz, told CNN her magazine obtained a copy of Luzhkov's letter through a source close to the Moscow mayor. She said she had no doubt that it was genuine.
The letter says that Luzhkov had been asked to resign voluntarily on September 17, and given first a day, then a further week, to think about it.
That week "allowed me to formulate a number of questions which are of concern not just to me," said the letter.
It calls for the resumption of direct elections for Moscow mayor, abolished when current prime minister Vladimir Putin was president.
It goes on to slam Medvedev for saying at a recent forum on democracy that those who disagree with him can join the opposition.
"This reminds me of another quote which went down in history: 'Those who are not with us, are against us,'" Luzhkov wrote, paraphrasing Vladimir Lenin, the founder of Russia's Communist revolution.
He went on to accuse Medvedev of orchestrating, or at least tolerating, a smear campaign against him.
In recent weeks, Luzhkov has been the subject of an unprecedented attack in Russia's state media.
The most serious accusation is of corruption: One news report detailed ways in which Luzhkov allegedly channeled funds and lucrative deals to his property-developer wife, now Russia's richest woman.
He was also criticized for failing to curb Moscow's notoriously bad traffic jams, and for going on a vacation during the forest fires and choking smog that plagued residents over the summer.
In a letter written to an executive of the pro-Kremlin United Russia party -- which Luzhkov helped create -- the mayor said his removal was politically motivated.
"I have been subjected to violent attacks from the state-owned media recently as a member of the bureau of the party's Supreme Council," said the letter, addressed to Andrei Vorobyov and distributed by the mayor's office to Russian news agencies.
"The attacks stemmed from the aim of removing the Moscow mayor from the political arena and stripping him of his powers ahead of time," Luzhkov said. "For over a month, I was subject to wild harassment that went beyond the limits of decency and common sense."
Luzhkov also denounced the United Russia party for not offering any support to him and for failing to "demonstrate any willingness to look into things and stop the flow of lies and slander."
"I ask not to be considered a member of United Russia any longer," said the former mayor.
Luzhkov had been at odds with Medvedev, most recently over the Kremlin's decision to suspend work on a controversial highway project through a Moscow forest.
At a political event earlier this month, CNN asked Luzhkov about the latest allegations and whether the Kremlin was trying to push him out.
"Would you mind if I do not answer that question?" he responded.
With Luzhkov's ouster, Medvedev has completed the removal, one by one, of an entire generation of strongly-entrenched, Yelstin-era regional leaders who had been clinging to power for many years and sometimes decades.
CNN's Matthew Chance, Maxim Tkachenko and John Dear contributed to this report.