The forests around Vovchansk were burning, white smoke drifting through the pines and billowing above the treetops where artillery shells had started fires.

Vovchansk and the other towns and villages along Ukraine’s northeastern border with Russia have lived under shellfire from Russian forces across the border for months. But in the past five days, the attacks have exploded with a sudden intensity after groups of exiled Russian fighters — who are aligned with Ukraine against the Russian government — attacked several settlements inside Russia, and Russian forces responded with force.

In the southeast, Ukraine’s leaders were dealing with an unfolding catastrophe on Wednesday, as surging waters from a destroyed dam on the Dnipro River forced thousands of evacuations. But near the northern border the anxiety centered on the continued cross-border hostilities, with both sides trading heavy volleys of artillery shells this week.

Vovchansk, two and a half miles from the Russian border, is mostly a ghost town. There are few cars on the roads except military and police vehicles. Barely 1,000 people remain after months of shelling that has damaged many residential houses and central buildings, and most were hiding indoors.

“In these four days, we cannot understand what is going on,” said Iryna, who is living in the town with her two daughters and six dogs. “Drones are flying all the time.” As with many civilians in frontline areas in Ukraine, her surname is being withheld for security reasons.

As she spoke, the deep rumbling of an exploding artillery shell sounded on the edge of the city, followed by a couple of sharp retorts of outgoing artillery.

Her daughters, who returned recently from Russia, are getting used to the shelling, she said. They have been caring for a growing collection of dogs they took in after they were left behind by neighbors who had moved away.

In Vovchansk, Ukrainian officials declined to comment on the recent military operation. But they have said that Ukraine needs to push Russian forces away from the border to reduce the shellfire on the wider region — suggesting tacit support.

“They are terrorizing the people,” said Tamaz Gambarashvili, the head of the civil-military administration in Vovchansk.

The city was occupied by Russian forces for seven months and then, after a sweeping Ukraine counteroffensive in September forced the Russians to withdraw, the residents suffered a grim winter. Russia unleashed a torrent of daily artillery and mortar strikes as part of its winter offensive across eastern Ukraine.

The latest fighting cut electricity and telephone services, adding to people’s difficulties. The local authorities have focused on providing food and other supplies, including construction materials for damaged houses, to the remaining population.

Two villages that lie even closer to the border than Vovchansk are almost abandoned, the police chief said. There are only two residents left in one of the villages.

The head of the local education department, Lyudmila Madiani, said it was providing online classes for 600 children still in the district, but had to suspend them in the last week because the internet went down. Only four of 21 schools in the district have survived the war undamaged, she said.

The attack on the Russian towns of Shebekino and Novaya Tavolzhanka led to the evacuation of several thousand residents of the area and pushed Russian forces back from the border so that close-range mortar teams are no longer active, Mr. Gambarashvili said.

“Now it is not only us suffering,” he said. “We hear they are suffering also.”

Two anti-Kremlin groups, the Russian Volunteer Corps and the Free Russia Legion,have claimed responsibility for several attacks over the border in recent weeks and have created a storm of publicity. They have made a point of filming and distributing videos to announce their presence.

Their main aim was to create a diversion and draw Russian forces away from the battlefront in Ukraine, as well as to start creating a demilitarized buffer zone along the border, Aleksandr Fortuna, the chief of staff of the Russian Volunteer Corps, said in an interview via Zoom on Tuesday. He said that the military operation was still continuing, and that their fighters had succeeded in taking part of the town of Shebekino.

Russian military bloggers have criticized Russia’s withdrawal from the border towns in Ukraine, saying continued control of the settlements would have protected against the recent incursions. Ukrainian officials say it would be better if Russian forces were pushed back further from the border and a buffer zone inside Russia established.

“There is only one solution: a 100-kilometer demilitarized zone,” said Maksym Stetsyna, the burly chief of police, who was wearing body armor and a baseball cap.

On a tour of the town, Oleksiy Kharkivsky, chief of the patrol police, pointed out a house that was still smoldering; shells had hit it over the weekend and set it on fire. He said he went out to every shelling site to check for casualties.

“We are usually the first on the scene,” he said. “We get a call, put on our body armor and go.”

Incendiary munitions set fire to houses in a residential district early Sunday morning, and two grandmothers died in artillery strikes around the same time, said Ihor Kharchenko, head of investigations for the Vovchansk regional police.

“Last week, they shelled with everything they had,” he said of the Russians. “They fire artillery and incendiary bombs. They have multiple rockets launcher systems like we have and sometimes a tank pops out and fires and then goes back and hides.’’

A multiple rocket launch system hidden in the countryside on the outskirts of Vovchansk roared into action as he spoke, sending a volley of some 40 rockets toward Russia. “That’s our artillery going out,” he said.

Although the anti-Kremlin groups, made up of Russians, have claimed responsibility for the attacks inside Russia, there are signs that Ukrainian forces have also been part of the assault, including long range artillery. During a visit of several hours to Vovchansk on Monday, there seemed to be more outgoing Ukrainian artillery fire than incoming Russian fire. Mr. Fortuna said the equipment and weaponry belonged to his force.

Iryna, the mother of two, said she worried about the increase of Ukrainian armor and troops that had arrived in town. One group had parked under the trees across the street, she said.

“The border is very close,” Iryna said. “We know when our guys shell them, we await the reply.”