The battle for the eastern Ukrainian city of Bakhmut is essentially over, for now. After 10 months of brutal artillery duels, frantic troop advances and thousands of Russian and Ukrainian casualties, Moscow’s formations are in control of the industrial hub, while Kyiv’s troops are trying to put pressure on the city’s flanks.

But what comes next for Russia, which has said it aims to capture the entire eastern Donbas region, is unclear. Earlier in the battle, Moscow had hoped to use the capture of Bakhmut as a springboard for further advances to the west — aspirationally toward the larger cities of Kramatorsk and Sloviansk. That goal seems out of reach for now.

Russian troops appear spent, military analysts say, after suffering extensive losses in securing Bakhmut. And overall, President Vladimir V. Putin’s forces have shown little ability to take more territory elsewhere, having been mostly relegated to smaller-scale attacks in a smattering of towns in the country’s east.

Ukraine, in the meantime, has trained new formations, armed and equipped by the West, and is expected to launch a broader counteroffensive somewhere along the roughly 600-mile front line.

This has Russia in somewhat of a defensive crouch, its forces stretched, as they build fortifications and prepare for the war’s next phase.

“We’ll probably see more localized tactical assaults,” Rob Lee, a military analyst at the Foreign Policy Research Institute, said of Russian forces. “But Russia will likely primarily focus on defense and prepare for Ukraine’s counteroffensive.”

Russian forces have spent much of the winter and spring digging in and preparing for Ukraine to strike, though some units have continued to attack in areas such as Kreminna north of Bakhmut and Avdiivka to the south. Those assaults have gained the Russians little ground, and instead have decimated the population centers in their path while depleting their own ranks.

In the south, which some military analysts predict will be the focus of Ukraine’s offensive, Russian forces have dug an intricate network of primary and secondary trench lines and minefields to thwart any Ukrainian advance, according to satellite photos and analysts.

If Ukraine does manage to retake territory, analysts say, that could give Russia’s far larger air force an upper hand as Ukrainian troops push forward, outside the range of their air defenses.

Further to the southwest, Ukraine now holds the southern port city of Kherson after reclaiming it in November. But with the Dnipro River serving as a natural boundary, Russian artillery units can shell the city from the eastern side with little risk of being overrun by Ukrainian ground forces, given the difficulty of crossing a wide, exposed waterway.

To the north, Ukrainian-backed proxy units have penetrated the Russian border in recent days, seizing a small batch of territory in what is considered a propaganda move to tie up Russian forces and embarrass the Kremlin following the seizure of Bakhmut.

But the battle for Bakhmut came at a significant cost for Russia and Ukraine and will weigh heavily on what comes next. Both sides made outsize investments in men and matériel to take and hold a relatively small and now-devastated city, which had a prewar population of more than 70,000.

Such is the nature of the 15-month-old war: Both militaries, still rooted in Soviet-style tactics, continue to rely heavily on artillery, tanks and limited troop advances to seize and control ground.

“The battle for Bakhmut is less important in terms of territory and more in its impact on both forces and what it reveals about them,” said Michael Kofman, the director of Russian studies at CNA, a research institute in Arlington, Va.

Russian forces were defeated on three fronts last year — around Kyiv, in the northeastern Kharkiv region and at Kherson. Moscow is nursing its exhausted and casualty-ridden formations after brutal urban combat in Bakhmut. Ukraine, too, is plagued by casualties, but is digging in along far more favorable and higher terrain outside Bakhmut.

In recent days, Ukrainian forces have made small gains to the north and south of Bakhmut, putting their forces in a better position to prevent Russian troops from advancing further. The head of the Wagner paramilitary force, Yevgeny V. Prigozhin, whose fighters were primarily responsible for the seizure of Bakhmut, has pledged to pull them from the city and turn its defense over to Russia’s uniformed ranks, risking a disorganized turnover of troops.

Wagner “isn’t really designed for defensive operations,” Mr. Lee said.

Mr. Prigozhin’s Wagner group has proved to be one of Ukraine’s most formidable foes and it remains unclear how its departure from the battlefield could affect Ukraine’s ability to put pressure on Bakhmut and beyond.

Military analysts, Western intelligence agencies and Ukrainian officials have argued over the strategic significance of the Bakhmut campaign for months. Moscow could have invested the resources elsewhere on the front line instead of wasting lives and ammunition for a few miles of land, they said. Kyiv could have retreated earlier, saving its battalions, brigades and supplies for future offensives.

Both sides’ decisions to stand and fight will have lasting effects on their future maneuvers.

The battle for Bakhmut was unique in that the Wagner group relied on formations of prison inmates to attack Ukrainian trenches, to both overwhelm their defenses and expose Ukraine’s firing positions. Russia’s ability to replenish its ranks, often with undertrained forces, had at one point been one of its advantages as it has forced Ukraine to risk its better-trained units to stop raw troops the Russians treated as expendable.

But Ukraine fought back, despite losing ground in the city and taking an outsized number of casualties. They took advantage of the open fields and tree lines on the outskirts, and used Western-supplied precision artillery such as HIMARS rocket launchers and 155-mm howitzers to wound and kill Russian troops at a distance.

Now, Moscow has to decide whether to try to advance west of Bakhmut. A few miles away lies the town of Chasiv Yar, but Ukraine can pull back to high ground in between, where it could fire down at advancing Russian troops. More likely, the Russians will focus on defending Bakhmut and its approaches.

The aftershocks of the battle for Bakhmut are not yet fully known, both in terms of overall casualties on both sides or how much equipment or ammunition was lost or destroyed. Western estimates early this year put Russia’s casualties in wounded and dead at about 200,000 since its invasion, and Ukraine’s are thought to be similar. The fight for Bakhmut has since claimed thousands more casualties.

“This chapter will close, even as fighting continues in the fields outside the city, but it speaks volumes about the Ukrainian will to fight, though soldiers may wonder whether the fight for Bakhmut was driven by political considerations over military ones,” Mr. Kofman said.