When Russian President Vladimir Putin ordered unmarked troops to Ukraine in 2014, first in Crimea and then the eastern borderlands of the Donbas, they were better equipped, trained and organized - and they crushed their opponents.
Eight years on, the roles are reversed. That's due to a multitude of factors: The modern weapons and training provided to Ukraine by its allies, the vastly better morale of its military, the caliber of its commanders, intelligence and planning aid from the US, plus catastrophic tactical errors by the Kremlin and its generals.
One cause, however, stands out: The very different ways in which two armies both with Soviet roots have learned to fight.
The impact on and off the battlefield has been profound, with Ukrainian forces able to conduct rapid, combined force operations in a September drive from Kharkiv in the northeast to the Donbas region that, just months earlier, had proved beyond the capabilities of their Russian adversaries.
In the southern Kherson region, Ukraine has added a third major front where is forcing Russian troops into retreat, following Kharkiv and, back in April, the capital, Kyiv. On Saturday, a huge explosion hit the bridge Putin built to connect Crimea with the mainland.
"He is not joking," US President Joe Biden said Thursday, of Putin's threats to deploy tactical nuclear weapons. "Because his military is, you might say, significantly underperforming."
The poor Russian performance has sparked a backlash at home, with hawkish figures from Chechen strongman Ramzan Kadyrov to reputed mercenary chief Yevgeny Prigozhin lashing out at the failures of military commanders. On Saturday, Putin for the first time publicly put a single general — Sergei Surovikin — in command of the entire Ukraine operation. Surovikin heads Russia's air force and had been in charge of the invasion's southern theater.
People close to the Russian defense ministry said they recognized the efficiency of Ukraine's more devolved command structure from the early stages of the war. Russian military bloggers, meanwhile, have described the disorienting effect of attacks from the rear by small, mobile Ukrainian units, because it's difficult to know in real time how big the threat of encirclement is.
After its 2015 defeat, Ukraine's regular army had to be rebuilt almost from scratch. Hollowed out by decades of underfunding, corruption and later deliberate degradation under the pro-Russia former President Viktor Yanukovych, it could field just 6,000 combat ready troops against Russia's hybrid forces.
A clutch of defense ministers Yanukovych appointed before being forced from office in 2014 have since been prosecuted; in one case the charge was "treason in the interests of the Russian Federation." By the time Andriy Zagorodnyuk, a civilian entrepreneur, was parachuted into the ministry to drive reform in 2015, it was clear to him that a Russian plan to "demilitarize" Ukraine had been underway for years.
"It was never just about the Donbas," said Zagorodnyuk, interviewed in Kyiv. "It was from the start about controlling all of Ukraine."
When Putin launched his invasion earlier this year, it was with a military that for eight years had been lavished with extra spending and equipment. If the US agreed with the Kremlin on anything, it was that Ukraine's defense force was outclassed and that Kyiv could fall in a matter of days.
That didn't happen in part because at the core of Ukraine's military reform, according to Zagorodnyuk, was the principle of "mission task command," in which decision-making is handed to the lowest possible level.
"It is exactly the opposite of what happened in the post-Soviet and Russian armed forces," said Zagorodnyuk, who served as defense minister from 2019 to 2020. He traced a 30-year post-independence trajectory in which both nations - including their militaries - were learning from very different pasts: One authoritarian and imperial, the other rebellious and individualistic. "It's the same reason why the war is being fought."
The military was among the last institutions in Ukraine to change. Still, according to Zagorodnyuk, the reforms were "transformational." Add NATO training, the development of a new US-style corps of non-commissioned officers with decision-making powers and accorded greater respect, plus eight years of experience fighting in the Donbas, and the profile of Ukraine's military has become dramatically different from Russia's.
On Sunday, the German newspaper Welt am Sonntag reported the European Union has agreed to train a further 15,000 Ukrainian soldiers in EU countries, starting with Germany and Poland.
According to Zagorodnyuk, as many as 500,000 Ukrainian men and women cycled through the trenches along the 2015 Donbas cease-fire line, where fighting continued daily despite the truce, right up to Putin's Feb. 24 invasion.
After intervening directly, if covertly, to decide the 2014-2015 Donbas conflict, Russia mostly sent officers to coordinate the fight in the trenches. As a result, it never had that training ground for its troops. Whereas the vast majority of Russian soldiers who came to Ukraine in February had never been to war, Ukraine had both a serving military and deep bench of reserves that had.
At least as important are the young officers who served in the Donbas from 2014, trained with NATO and rose to become generals - including the 49-year-old commander in chief of Ukraine's armed forces, Valeriy Zaluzhnyi.
That difference has significant implications as Putin orders a mobilization of fighting age men that have at some point served in the armed forces, months after Ukraine ordered its own draft. Russia's mobilization aims to raise about 300,000 new recruits, but there are few qualified officers available to train them into a fighting force, and no empowered NCOs to mentor them within units.
Nor can the rigid, top down nature of the Russian military command structure be easily altered in the political system Putin has created since coming to power more than 20 years ago.
While the war's outcome is far from decided and Russia's armed forces retain advantages in key areas such as sheer quantities of artillery, long range missiles and aircraft, they have for now lost the initiative to Ukraine.
"I think our experience since 1991 contributed a lot," says Mykola Bielieskov, research fellow at the National Institute for Strategic Studies, a Ukraine government think tank. That includes the 2004 Orange and 2014 Maidan popular revolts, as well as the Donbas conflict that followed, when Ukrainians instantly self-organized to feed protesters, form militias or crowd fund basic medical and military supplies.
By February, when Ukraine came under attack from a vastly larger and better equipped Russian force, it was only the instinct to self-organize that saved cities like Kharkiv, Mykolayiv and Kryvyi Rih from being overwhelmed, because in many cases there was little or no regular army to defend them.
"We needed to improvise to survive," Bielieskov said. If people had waited for orders from Kyiv, or "we'd fought the way the Russians do, we'd have been quickly overwhelmed."
As Ukraine has moved onto the offensive, those advantages have been on display again. Like Russia, it has faced the challenge of having to break through defensive lines without the air superiority needed to protect its forces from ambush or counterattack.
Reliant on slow moving artillery, Russia could only pound Ukraine's defenses and then edge slowly forward in the Donbas. In its drive east from Kharkiv, by contrast, Ukraine, could bring its heavy guns forward in real time to perform the role of air cover, according to Bielieskov.
That was partly down to having some mobile systems like the French Caesar and Polish Krab self-propelled howitzers to deploy. But it was also because Ukraine's gunners had learned to rapidly dismantle and reassemble the much more plentiful, static, US M777 howitzers.
"I think the Russians made a big mistake giving us eight years to prepare," said Bielieskov.
Track Latest News Live on NDTV.com and get news updates from India and around the world