KHARKIV, Ukraine—Ukrainian forces are ousting Russian troops from a string of villages that were used to strike the country’s second most-populous city, Kharkiv, regaining strategic terrain that could blunt Russia’s attempt to conquer the eastern Donbas region.

The recent Ukrainian gains, to the north and northeast of Kharkiv, build on previous successes in forcing Russia’s military from the immediate outskirts of the city, a major industrial and transportation hub with a prewar population of 1.4 million.

Another setback for Russia came when the European Union on Wednesday proposed a ban on Russian crude and refined oil products, and prepared to impose sanctions on Russian military figures whom EU officials accuse of war crimes. With the tighter restrictions pending, Europe stocked up on oil and natural gas. Brent crude futures for July delivery on Wednesday gained $5.17 per barrel, or 4.93%, to $110.14.

On the battlefield, Ukrainian troops on Friday captured the village of Ruska Lozova just north of Kharkiv, according to residents and the Ukrainian military. In the following days, a separate group pressing northeast expelled Russian forces from the village of Kutuzivka. The group has now reached the town of Staryi Saltiv, some 25 miles away, said Ukrainian officials. Pursuing the offensive farther east of Staryi Saltiv would threaten Russian supply lines toward Izyum, the staging ground of Moscow’s main military effort to seize Donbas.

While some Russian units remain on the edge of Kharkiv, these offensives have led to a dramatic decrease in the shelling of the city, said Oleh Synehubov, the head of the Kharkiv region’s military-civilian administration. The number of Russian shelling and rocket attacks on Kharkiv in the past week fell to between two and five a day, he said, from between 50 and 80 before then.

“The successful offensive of the Armed Forces of Ukraine in the north of the city has forced the enemy away. In several areas, it is now out of range to strike the city,” Mr. Synehubov said. “Because of this operation, the enemy’s fire is no longer concentrated on the peaceful residents of Kharkiv, but on the positions of our armed forces.”

Northern neighborhoods of Kharkiv have been hit hard in two months of Russian shelling.

Lt. Col. Vito, deputy commander of the unit of Ukrainian military intelligence that led the operation to retake the village of Ruska Lozova, north of Kharkiv.

Russia’s Defense Ministry didn’t respond to questions about the status of the villages near Kharkiv or Moscow’s strategy in and around the northeastern city. Russian state media aired an anonymous interview with a man purported to be from one of those villages in which he said Russian troops were never there to begin with.

Kharkiv’s northern neighborhoods were obliterated in the past two months by Russian shells, rockets and missiles, with more than 2,000 high-rises rendered uninhabitable across the city, according to the municipality. Residents in the most-affected areas, such as Saltivka, spent weeks stuck in basements without power and water, forced to cook on open fires in courtyards during the lulls in shelling.

Despite continued Russian attacks, city residents have re-emerged on the streets. A handful of restaurants and coffee shops have reopened, with traffic on some roads that had been deserted since the war began.

“Springtime has come, the weather is nice, the sun is shining and people want to eat out again now that things have calmed down in the city,” said Stanislav Lubimsky, who reopened his downtown Pizzeria 22 on Monday. “Let’s hope everything stabilizes and continues like this, toward victory.”

Only one axis of the initial Russian advance, ending in the village of Tsyrkuny, remains in the immediate vicinity of the city, Ukrainian officials say. These positions are increasingly threatened by Ukrainian advances in Ruska Lozova to the west and Kutuzivka to the east.

A woman from the village of Ruska Lozova after fleeing to nearby Kharkiv.

Nina Lavrova, another resident of Ruska Lozova, said her son Serhiy is missing after he was detained by Russian forces.

Ruska Lozova, which sits on the main highway from Kharkiv to the Russian city of Belgorod, was occupied by Russian forces immediately after the war began on Feb. 24. For two months, the village of 5,000 people was cut off from Kharkiv and the rest of Ukraine, and put under harsh military rule, residents say. Cellphone coverage was disabled, food supplies stopped and electricity disappeared.

Serhiy Shumov, 39, who worked before the war at a nearby sausage factory that he said has since been looted by the Russians, said he weighed 212 pounds before the war. By the time he fled Ruska Lozova to Kharkiv on Friday, he was 165 pounds. “There was nothing to eat for two months, everyone was just scavenging for whatever they could find,” he said.

A succession of Russian forces rotated through Ruska Lozova—regular Russian troops of different units, and then poorly trained recruits from the Russian-controlled statelets in Donbas who appeared in tracksuits and torn sneakers, residents said. While the Russians checked residents’ homes and phones, they didn’t steal from inhabited houses. Those abandoned by residents were another matter.

“They were taking everything they could from these empty homes: electronics, TV sets, even half-empty perfume bottles. They were saying: We are going home on rotation soon, and we need to bring gifts,” said Vadim Zhirnovnikov, a 52-year-old truck driver who left Ruska Lozova for Kharkiv on Sunday because of continuing Russian shelling there.

A Russian rocket attack hit an amusement park in Kharkiv on Tuesday.

Ukrainian ambulance and military personnel in northern Kharkiv on Wednesday.

The village, 13 miles from the border crossing with Russia, is home to many ethnic Russians. Perhaps half the population was sympathetic to Moscow before the war, Mr. Shumov said. Some, including the mayor, chose to collaborate with the Russians when they invaded, Mr. Shumov and Ukrainian military officials say.

When the occupation began, Mr. Shumov said the mayor told villagers, “Understand, the Russian soldiers are good people, work with them.” At another gathering, a bearded Russian commander urged residents to relocate to Russia, Mr. Shumov recalled. “He told us: We will soon liberate Kharkiv, so please in the meantime go to Russia because these Ukrainian Nazis will shoot at you and burn your cars.”

Mr. Synehubov, the head of the regional administration, wouldn’t comment on Ruska Lozova’s mayor but said that Ukrainian law enforcement is investigating all alleged cases of abetting the enemy. “We do know that some collaboration has occurred, including by some people who held positions in local government authorities,” he said.

With hunger pressing on Ruska Lozova under occupation, 25 villagers tried to raid the giant chicken farm nearby to get some meat on April 15, said Nina Lavrova, 63, whose son Serhiy was among the men. The trespassers were caught and detained by Russian forces. Ms. Lavrova said one of the villagers who was detained alongside her son and later returned to the village told her that Serhiy had been press-ganged into forced labor for the Russian forces somewhere near Belgorod.

“I don’t know where he is and he doesn’t know where I am,” said Ms. Lavrova, who arrived in Kharkiv on Monday.

A woman reacted to nearby shelling in Kharkiv on Wednesday.

Artillery damage in a village in the Zaporizhzhia region, in southeastern Ukraine, last week.

The long list of Ruska Lozova’s villagers who have also gone missing includes Mr. Shumov’s father-in-law, who disappeared on March 24. “He just walked out to the street and vanished. Nobody knows where he is,” Mr. Shumov said.

More than half of Ruska Lozova’s residents, including most of the collaborators, had escaped the village for Russia by the time Ukrainian forces began the operation to retake it last week, residents and officials said.

“The pro-Ukrainian people have remained,” said Lt. Col. Vito, the deputy commander of the Kraken unit of Ukrainian military intelligence that led the operation to retake Ruska Lozova. Like other military officials, he is allowed to identify himself only by his call sign.

The choice of evacuating to Russia wasn’t always political, villagers say. Some of those who initially escaped to Russia have since managed to move on via Lithuania, traveling to wait out the war in Poland or Germany.

When Ukrainian forces pushed into Ruska Lozova on Friday, Ukrainian artillery shelled Russian positions in and around the village at first, and then infantry moved in from three directions, Lt. Col. Vito said. “The most important thing was the surprise of the attack,” he said. “The enemy resisted, and they were liquidated. Some have managed to retreat, and some have remained there forever.” His unit took three Russian prisoners in the village, he said.

Mr. Shumov said his sons, 13-year-old twins, ran to him that day to say that the troops in the streets wore Ukrainian pixelated uniforms. “People cried of happiness when they saw our soldiers,” he said.

As Russia unleashed fire on the village in following hours, destroying several houses on Mr. Shumov’s street, Ukrainian troops focused on evacuating most of the remaining civilians to the relative safety of Kharkiv. Hundreds left in a convoy of minibuses on the first day, housed by Kharkiv authorities in a dormitory on the city’s southern edge. Others keep trickling out every day, taking advantage of pauses in Russian shelling. The village remains off-limits to journalists.

A Ukrainian serviceman in a damaged schoolroom in northern Kharkiv on Wednesday.

Photo: Manu Brabo for The Wall Street Journal

Arrivals from recently retaken areas are screened by Ukrainian authorities looking for collaborators. At a checkpoint leading out of Ruska Lozova, on a road littered with charred debris, security officials instructed troops to detain and send for interrogation anyone found with photos of Ukrainian positions or recent calls to Russian numbers on their phones.

Vera Nikitichna, 70, spent Friday with her husband, Fedor, in the cellar as the village was shaking under Russian bombardment, she said. Then, Ukrainian soldiers appeared in her courtyard. “They said, get out of here quickly, there will be a nightmare here soon,” she recalled. Her husband, 80, refused to leave, saying he needed to finish planting potatoes in their garden. In the rush, they became separated and Ms. Nikitichna now spends her days standing outside the dormitory in Kharkiv, waiting for news from other villagers who arrive from Ruska Lozova. Cellphones still don’t work there. Her husband likely thinks she has died and is looking for her body, she said.

“We used to live peacefully, didn’t touch anyone. And now we have become penniless and homeless in our old age, when nobody needs us,” she said. She had never imagined her village would be destroyed by Russians. “Why the hell did they have to come?” she said.

Write to Yaroslav Trofimov at yaroslav.trofimov@wsj.com