In vicious but mostly static fighting in snowy, artillery-cratered fields and ruined cities, Ukraine rebuffed a Russian offensive over the winter. Now, it is Ukraine’s turn to go on the attack.

Signs are everywhere that it is coming in the next month or so.

New Western weapons that could prove critical in assaults, like German Leopard 2 tanks and American mine-clearing vehicles, are arriving in Ukraine. Thousands of recruits are training in newly constituted units tailored for offensives. And the military command is holding back elite soldiers from the worst of the fighting in the east, in and around the city of Bakhmut, to throw them instead into the coming campaign.

After more than a year of war, Ukraine is battle hardened. “We are covered in three centimeters of stone,” one fighter, Lt. Ilya Samoilenko, said in a recent interview.

But that toughness has come at a steep cost. Ukraine has lost thousands of its most experienced fighters. Now Lieutenant Samoilenko, a veteran commander and survivor of the siege of the city of Mariupol, is using his experience to train new recruits.

The new Ukrainian campaign, when it comes, will be a test of its army’s ability to re-arm and reconstitute battalions while maintaining the motivation and maneuvering skills that gave it an edge in three previous counteroffensives.

The timing is critical. Success for Ukraine in the battles on the southeastern plains would drive home to the world the declining military might of Russia, ease concerns that the war has settled into a quagmire and most likely encourage Ukraine’s allies to further arm and finance Kyiv in the war.

Western support has been solid so far but is not guaranteed. The U.S. budget for military assistance, for example, is now expected to run out by around September, and a senior American defense official recently described the latest tranche of artillery rounds and rockets sent to Ukraine as a “last-ditch effort.”

“The key point in the eyes of Washington elites — and Washington elites are the judge and jury on this — is that Ukraine has to be seen as having gained significant land in the coming offensive,” Cliff Kupchan, chairman of the Eurasia Group, a political risk assessment firm in Washington, said in an interview.

The challenges are daunting.

Ukrainian officers will have to choreograph artillery, infantry and armored vehicle assaults that crash through Russian trenches, tank traps and minefields. In the south, Russian units have been building defensive positions since they were pushed out of the Kherson region in November. Sophisticated Western tanks, with better survivability and firepower, will be critical in uprooting those positions.

Ukraine had a standing army of about 260,000 soldiers before Russia invaded last year, and it quickly swelled to about a million people bearing arms in various branches of the security services and military. Over the past year, about 100,000 Ukrainian soldiers have been killed or wounded, according to Western estimates. Ukraine has not revealed how large a force it will commit to the counteroffensive.

Ukraine is seen as planning to drive a wedge through Russian occupied territory along the southern coasts of the Black and Azov Seas, near Crimea, or to seek a humiliating turnabout in the fighting in the eastern Donbas region — or both.

If weapons and trained troops fall into place in time, Ukraine is capable of inflicting losses on the Russian Army that could have far-reaching geopolitical consequences, Evelyn Farkas , the director of the McCain Institute, said in a telephone interview.

She posited a once-unthinkable outcome: that Ukraine could render Russia a weakened military power in Eastern Europe with little leverage in negotiations to end the war.

“People lack imagination,’’ Ms. Farkas said. “They only envision what they see now.”

But much could change, she said, with the influx to the front lines of the new Western weaponry and the tens of thousands of Ukrainian soldiers who have been training for the operation at home and in Europe.

Still, success is hardly assured. Allies have dragged their feet in sending weaponry, and soldiers have had to make do with crash courses in assault tactics.

“It’s a lot to learn in a short time,” said Rob Lee, a military analyst at the Foreign Policy Research Institute, said. And, he noted, “they will have to go before they get all the equipment.”

The weaponry and equipment for breaching trench lines and crossing minefields is falling into place, though it remains unclear if in sufficient quantity.

The Ukrainian military has posted photographs on Twitter of Stryker and Cougar armored personnel carriers from the United States, Marder armored vehicles from Germany and Challenger tanks from Britain. Last week, Ukrainian crews for Patriot air defense missiles wrapped up training in the United States, the Pentagon said.

The counteroffensive, at least in its opening stages, could well hinge on crossing sprawling minefields, military analysts say. To do so, Ukraine will be relying on the unglamorous but crucial mine-clearing machines it has in its Soviet-era arsenal. It has captured some from retreating Russians and is now also receiving mine-clearing devices from the West.

The Russian military has a vast arsenal of anti-tank and anti-personnel mines, with colorful nicknames like the Black Widow and the Leaf, some specifically designed to complicate demining with booby traps.

The demining can be done manually, with specially trained soldiers probing the soil and keeping a close eye for trip wires as they walk in front of assault units, or with specialized mine-clearing machinery. These vehicles fire a rocket that tows a long line of explosives. Draping the line over a minefield, then detonating it, clears a path for soldiers or armored vehicles.

If the engineers do not say “it’s done, the route is clear,” the infantry will not attack, said Markian, a lieutenant who commands a Ukrainian mine-clearing unit. He asked to be identified only by his first name and rank.

Preparing for the counteroffensive has come at a cost.

Russia has used convicts and mercenaries to wear down the enemy in the monthslong fight at Bakhmut, stretching Ukraine’s exhausted, battered soldiers to the limit. Ukraine has tried to avoid taking the bait, deploying volunteer Territorial Defense units and delaying rotations.

The village of Oleksandro-Shultyne, on one of the flanks in the battle for Bakhmut, for example, is defended now by the Ukrainian Volunteer Army, a unit that blends civilian volunteers with enlisted soldiers.

The village is a tableau of ruins, mud and snow. For months, seemingly endless waves of Russian soldiers waged assaults and the local commander, who goes by the nickname Sokil, or Falcon, conceded that his soldiers had been killed and forced to give ground in the months while Ukraine was fighting defensively.

But he hardly seemed disheartened.

“They concentrated their forces here,” he said of the Russian Army. “What does that mean? That we will attack somewhere else. And we have every possibility to do that now.”

In the counteroffensive, Ukraine is likely to launch intensive artillery bombardments along a narrow stretch of frontline, military analysts say, followed by demining teams and tank assaults.

Ukraine is widely expected to strike in the south, where the terrain ranges from wide-open farm fields, with only sparse tree lines for cover, to towns and villages. A thrust of about 50 miles over the steppe from the current front lines to the Russian-occupied city of Melitopol would split Russian-held territory into two zones, sever supply lines and put Ukrainian artillery within range of Russian bases on the Crimean Peninsula.

Preparing new recruits to replace dead, wounded and exhausted soldiers has been taking place for months. Tens of thousands of new recruits have undergone training in Europe and inside Ukraine, including in newly formed Offensive Guard units. About 35,000 Ukrainians have signed up for the assault units.

But morale, an area in which Ukrainian fighters held an edge for much of the war, is becoming more of a challenge. In a dozen or so recent interviews, soldiers at positions near Bakhmut or emerging from the crucible of street fighting for short breaks expressed dismay at the scale of violence and death.

“It’s never a calm sea,” Masik, a sergeant who was manning a position south of Bakhmut, said of his state of mind. “It goes up and down. I want to see my family, my kids.”

In one of the most striking examples of military rebuilding, the Interior Ministry is reconstituting the decimated Azov unit, all of whose active-duty soldiers were killed, wounded or captured in the siege of Mariupol and the holdout at the Azovstal steel last spring. Others died in an explosion at a Russian prisoner of war barracks in Olenivka.

One recent day, at a base in a pine forest, new Azov recruits marched, stood at attention and dropped for push-ups. They were learning basic soldiering skills in five weeks.

“We will train new people, to raise them up to our level,” said Lieutenant Samoilenko, who was freed from Russian captivity in a prisoner exchange.

To ensure that only the most motivated soldiers wind up in its assault unit, recruits are given a choice. At the end of the training course, they can choose to remain at the base, rather than deploy to combat. To do so, they ring a bell indicating they prefer to stay.

“We know how Russia fights, and we know how to counter it,” Lieutenant Samoilenko said. “Resilience is the ability to find new people, to move forward.”

Maria Varenikova contributed reporting from Kramatorsk, Ukraine.