DONETSK, Ukraine - To outward appearances, Fyodor D. Berezin is the picture of a senior military commander. He wears camouflage, has bodyguards and confidently gives orders as the newly named deputy defense minister of the separatist Donetsk People's Republic. Yet, just four months ago he was an obscure author of 18 science fiction novels, one play and a dozen or so short stories.
In an interview, Mr. Berezin said he was as surprised as anybody by his rapid promotion through the rebel ranks. "Reality became scarier than science fiction," he said in an interview over iced tea at the Havana Banana bar, a favorite rebel haunt. "I live in my books now. I fell right into the middle of my books."
In the real war in eastern Ukraine, it is an inauspicious time to hold a high command in the separatist forces. Under relentless pounding by the Ukrainian military, their rebellion is crumbling. Government troops have advanced to the outskirts of Donetsk, and over the weekend broke into the rebels' other remaining stronghold, Luhansk.
In the wake of these and other setbacks, President Vladimir V. Putin of Russia appears to be maneuvering for a face-saving settlement, analysts say, a way to escape a losing situation without puncturing his strongman image or antagonizing the ultranationalists at home who were expecting him to follow up his annexation of Crimea with an invasion of Ukraine.
Step 1 has been a change in leadership. In recent weeks, in what separatist officials hopefully call the "Ukrainianization" of the leadership, almost all the original Russian leaders of the rebellion have resigned and gone home, replaced by Ukrainians of dubious qualifications.
Aleksandr Borodai, a Russian citizen, stepped down as prime minister of the Donetsk People's Republic, to make way for a Ukrainian, Aleksandr Zakharchenko, who had led a police advocacy group before the war. In the Luhansk region, Valery Bolotov, a Russian citizen, announced last week he had "temporarily resigned" as prime minister and left for Russia for medical treatment. He was replaced by Igor Plotnitskiy, a former public health inspector in Ukraine.
Igor Girkin, who uses the nickname Igor Strelkov, or Igor the Shooter, a former colonel in the Federal Security Service who led the Russian military takeover of Crimea before arriving in eastern Ukraine, resigned as defense minister of the Donetsk People's Republic. Vladimir Kononov, a local resident and former judo instructor, took his place.
The shuffle also removed those in charge when Malaysia Airlines Flight 17 was shot down on July 17, including Igor Bezler, who used the nickname Bes, or the Demon. Mr. Bezler, a native of Crimea, appeared in a video in April identifying himself as a lieutenant colonel in the Russian Army. His location is unknown.
The only remaining senior Russian here is Vladimir Antyufeyev, a reputed spy who lived under an assumed name for a decade and is now the first deputy prime minister.
For the pro-Russian enterprise, the change of leadership was a gamble. While opening the prospect of peace talks, as the authorities in Kiev have refused to negotiate with Russian citizens, it has also left the rebel military ranks adrift, with control in the hands of local Ukrainians with modest résumés.
Their increasingly erratic leadership has been met with a breakdown in discipline in rebel ranks and signs of dissent and possible pro-Ukrainian resistance in Donetsk. There, unknown assailants sprayed a minivan of rebels with bullets over the weekend, and graffiti has appeared showing Mr. Strelkov shooting himself in the head, with the tag line "Just Do It."
Separatist fighters have taken to carousing drunkenly at night and wearing civilian clothes. This month, three of them crashed a car into the curb outside the Ramada hotel. On Saturday, two separatists again crashed at the same spot, rolling their vehicle and scattering broken glass and bullets on the street. On Tuesday, a drunken rebel, improbably, again crashed at that location, severely injuring four civilians.
As bystanders watched horrified, the drunken gunman, who was not wounded, drew a pistol and proceeded to kick one of the injured civilians, berating him for causing the accident.
In an attempt to maintain discipline, the prosecutor general of the Donetsk People's Republic announced on Saturday the introduction of the death penalty in newly formed military tribunals. In announcing the punishment, the prosecutor, Eduard Yakubovsky, said: "It's no secret that we have servicemen committing crimes. There are facts of marauding and violence."
As the Ukrainian Army closes in on the city, public statements by the Donetsk People's Republic have become ever more unbelievable, if not delusional. "The Ukrainian soldiers are defecting en masse," one statement said, on the authority of the new prime minister, Mr. Zakharchenko.
Finding competent, charismatic leaders for the separatist forces and governments has always been hard. At various times, senior positions have been held by the owner of a dog behavior school, a man who performed as Santa Claus, the operator of a Ponzi scheme and a reputed organized crime boss. But with the rebels' sagging military fortunes, the quest for able leadership has grown desperate. Mr. Berezin's elevation to deputy minister of defense, by his own account in part owing to his literary accomplishments, is a case in point.
He was an aide to Mr. Strelkov, a Russian citizen and staff officer of the Federal Security Service until last year. "He was the ingredient that crystallized the whole structure," Mr. Berezin said of Mr. Strelkov, who also led the covert Russian military takeover of Crimea. Mr. Berezin said he opposed Mr. Strelkov's resignation.
Mr. Berezin now serves under a little-known fellow Ukrainian, Mr. Kononov, who uses the nickname "the czar" in his duties as defense minister. Before the war, Mr. Berezin, 54, supplemented book proceeds with a day job as a purchasing official for a university, buying janitorial supplies. In the 1980s, he served in the Soviet Army with a rank of captain.
His eyes light up when talk turns to war, though not the kind raging on the outskirts of this besieged city, but rather battles fought in outer space between the Brashis and the Ararbacs, two civilizations on the planet Gaeia and in parallel dimensions from one of his novels.
Mauricio Lima for The New York Times
Mr. Berezin met Mr. Strelkov last spring, and by Mr. Berezin's account, the two got on well because of common literary interests, as Mr. Strelkov, too, is a science fiction fan. Mr. Strelkov had read one of Mr. Berezin's books, "Parallel Cataclysm," about a parallel dimension where the Soviet Union rules Earth and a red flag flies over the Eiffel Tower in Paris, Mr. Berezin said.
In the novel, a United States aircraft carrier group is sunk in the Pacific Ocean by a mysterious wing of fighter jets, later revealed to bear the red star of the Soviet forces from the parallel dimension, crossing over into our world to turn back the tide of American hegemony.
The author is soft-spoken, with a delicate turn of phrase, and a passion for writing that he came to late in life, after working odd jobs and raising a family. With dismay and self-deprecation unusual for a military man, he recounted his difficulties coping with his new command. When attention is diverted by one crisis, he said, another problem pops up, and people die, because this is a real war. "I am in charge of life and death decisions," he said.
Asked about his plans for defending the city, Mr. Berezin was a little vague, saying the Ukrainian Army would bog down in urban combat. And he described an "international brigade of the future," modeled on the legions of volunteers who flocked to Spain in 1936, rallying to the cause. For now, though, most volunteers are Russian, he said. "We really, really need help," he said.
Still, he described the conflict here in sweeping, millennial terms, even as the territory under his command has shriveled to the city limits of his hometown.
"We are at the geopolitical pinpoint of the world," he said. "The vectors converge here. Like an hourglass, the sides bend in here in Donetsk, and the sand passes and we are at this historical point. Depending on how the sand scatters, history will change one way or another."
He also recounted inexplicable luck on the separatist side. One rebel, he said, miraculously killed five Ukrainians with the five bullets in a pistol magazine. Another time, a rocket-propelled grenade sailed right into the open window of an attack helicopter, "defying all the rules of probability."
"I want the war to end, and I want to write about it all," he said. "It's an amazing fable. Every day, enough happens for a novel. I cannot talk about it all now, but when the war is over, I will write about it."
Andrew E.Kramer, The New York Times