The accounts of resistance in the small garrison town of Vasylkiv have already taken on the sheen of legend. There are reports of Russian transport planes shot down, paratroopers hunted in the woods and even an unknown Ukrainian pilot nicknamed the Ghost of Kyiv defending the skies.

Hyperboles aside, the people of this quiet provincial town of tree-lined streets and low-rise buildings dating to the Russian empire managed to fight off Russian troops in the critical opening days of the war, preventing Russian forces from capturing strategic bases that could have allowed the nation’s capital, Kyiv, to be encircled.

Vasylkiv, home to an aviation school that has trained generations of pilots, a counterterrorism task force and an air defense command center that protects the capital and central Ukraine, became one of the first targets of a Russian attack in the first hours and days of the war. Cruise missiles slammed into the air base, and then Russian airborne forces attacked in a series of ground assaults.

They did not prevail. Accounts from residents, government officials, armed forces personnel and civilians who have enlisted territorial defense units described how Ukraine rebuffed the Russian assault and helped prevent Russia’s wider aims to seize control of the country.

An air base was among the first targets hit at 5 a.m. on the morning of Feb. 24, in the opening salvos of the war. The strikes damaged buildings, equipment and air defense systems.

Russian airborne troops were dropped into nearby villages and began an assault, local officials and officers said. The Russian soldiers attacked during an air raid, using it to their advantage as Ukrainian troops took cover in bomb shelters.

“After the airstrikes, they tried to test the perimeter,” said one air force officer involved in fighting, speaking on condition that he only be identified by his rank — a major — and his military code name, KR@M. “They tried to sneak inside and they managed.”

For security reasons, the officer did not specify exactly where the battles took place, except to say the Kyiv region.

By the fourth night of the war, the Russian attackers had regrouped and were better organized, said the air force officer, KR@M, a member of the quick reaction unit that was involved in the battle.

He said the Russians were equipped with assault rifles, silencers and night vision goggles, enabling to them to attack in the dark.

“At 4 a.m., when the fighting started our guard was shot silently, in the head, in full darkness,” he said.

A fierce firefight broke out as the Russians entered the compound, he said. The Ukrainians swiftly lost six men killed, with two wounded. But with accurate fire and hurling grenades, he said they managed to kill five of the attackers and wound a sixth, forcing the remaining Russians to retreat.

“We are lucky they did not know how to throw grenades properly,” KR@M said of the Russians. “If they had managed to throw grenades, it would be very sad,” suggesting the Ukrainians could have been overrun.

The Russians seemed to have had back up, because there were signs they dragged their dead and wounded with them. “We saw the blood stains but found no bodies,” KR@M said. They even retrieved their shell casings, he said.

He said he was the only Ukrainians with a thermal imaging night vision and was able to shoot three of the attackers. He mourned his lost comrades, who he said did not have the same advantage. “The hardest thing, as always, is to lose your friends,” he said.

After that battle on Feb. 26, the Ukrainians spotted scouts conducting reconnaissance around the perimeter of their bases, but the Russians did not mount any further attacks. Then, about a week ago, they disappeared altogether.