The city of Kyiv covers 325 square miles and is divided by a broad river. It has about 500,000 structures — factories, ornate churches and high-rise apartments — many on narrow, winding streets. Roughly two million people remain after extensive evacuations of women and children.

To the northwest and to the east, tens of thousands of Russian troops are pressing toward the city, Ukraine’s capital, backed by columns of tanks, armored vehicles and artillery. Inside Kyiv, Ukrainian soldiers and civilian volunteers are fortifying the downtown with barriers, anti-tank mines and artillery.

Kyiv remains the biggest prize of all for the Russian military; it is the seat of government and ingrained in both Russian and Ukrainian identity. But capturing it, military analysts say, would require a furious and bloody conflict that could be the world’s biggest urban battle in 80 years.

“What we are looking at in Kyiv would dwarf anything we’ve seen since World War II,” said David Kilcullen, a retired lieutenant colonel in the Australian Army who has extensively studied urban combat. “If they really, really want to level Kyiv, they can,” he said of the Russian leadership. “But the level of political and economic damage would be tremendous.”

For comparison, one of the largest urban battles this century was the nine-month siege of Mosul, Iraq, in 2016 and 2017 to oust its Islamic State occupiers. Mosul covers 70 square miles and had a wartime population of about 750,000 people — a fraction of the numbers for Kyiv, where the metropolitan area’s prewar population was 3.6 million.

Negotiations over a cease-fire are continuing, and a long, heated battle over Kyiv is not inevitable. Despite superior numbers and firepower, Russia has not achieved a breakthrough. A Western official, in a briefing with reporters this past week, said the Russians had taken heavy casualties, been unable to establish any meaningful off-road presence, and — perhaps most surprising — failed to achieve dominance in the air.

But the first stages of the battle have already begun, with cruise missile bombardments, troop movements to encircle the city and a fight to gain air superiority. Savage, street-by-street gunfights akin to guerrilla warfare have broken out in northwestern suburbs like Irpin, an important gateway into the city. It could be the beginning of a long, drawn-out siege using hunger and street fighting to advance toward the city center.

After three weeks of fighting in the suburbs, Ukrainian soldiers and volunteers, who are operating in loosely organized small units and relying heavily on ambushes, are growing more confident in the city’s defense. Part of their strategy is to make the assault so costly for the Russian army in lives that it will exhaust or demoralize its troops before they reach the city center.

“There’s no talk of capitulation for Kyiv,” said Lt. Tetiana Chornovol, the commander of an anti-tank missile unit operating on the outskirts of the city. “Everything is going far better than we thought.”

Lieutenant Chornovol, 42, is a former activist in Ukraine’s street protest movement who sent her two children to safety before reporting for duty as a reserve officer. She commands two teams of a half-dozen or so people each, firing Ukrainian-made, tripod-mounted missiles, which they transport to ambush positions in their personal cars.