KYIV, Ukraine—Russia said it had taken complete control of the southeastern port city of Mariupol on Saturday after the surrender of the last remaining Ukrainian forces there, while Moscow’s troops pressed an offensive in the country’s east.

Ukrainian President Volodymyr Zelensky described the soldiers and marines who had defended Mariupol through a monthslong siege as national heroes. He said the military had told them to get out and save their lives.

Russia’s Defense Ministry said a final group of 531 Ukrainian fighters had been evacuated from bunkers under the sprawling Azovstal steel plant to Russian-controlled territory, bringing the total number of prisoners taken from the plant to 2,439, it said.

“The underground facilities of the enterprise, where the militants were hiding, came under the full control of the Russian armed forces,” the ministry said.

Ukrainian service members who surrendered at Mariupol’s Azovstal plant were taken to another part of Donetsk on Friday.

Photo: ALEXANDER ERMOCHENKO/REUTERS

Completing the capture of Mariupol was a long-sought victory for Russia, which has faced fierce resistance and struggled to gain ground against Ukraine’s armed forces since it launched its invasion on Feb. 24.

By holding out for weeks in ever-smaller pockets, Ukrainian defenders tied up large numbers of Russian troops, preventing their deployment elsewhere.

By the time of their surrender, the resistance at the Azovstal plant had more symbolic than strategic significance. Russian forces have for weeks controlled a land corridor linking the Crimean Peninsula, which Russia annexed in 2014, with the eastern Donbas region, where Russia also has controlled territory since 2014.

Russia’s state-run RIA Novosti news agency on Saturday published video reports from supermarkets in a Russian-held part of the Zaporizhzhia region and the Russian-occupied city of Kherson in southeastern Ukraine, saying they were stocked from goods coming via Crimea.

On Thursday, the International Committee of the Red Cross said it had registered hundreds of Ukrainian prisoners of war from the Azovstal plant. The group is visiting prisoners of war on all sides, it said.

Much of Mariupol is in ruins after months of bombardment.

Photo: ALEXANDER ERMOCHENKO/REUTERS

Emergency workers transport the body of a person killed during the fighting in Mariupol.

Photo: ALEXANDER ERMOCHENKO/REUTERS

Leonid Slutsky, head of the international affairs committee in Russia’s lower house of parliament, said Saturday that Moscow would explore the possibility of swapping the Mariupol fighters for Viktor Medvedchuk, a detained Ukrainian ally of Russian President Vladimir Putin,

in remarks carried by Russia’s Interfax news agency.

Mr. Medvedchuk headed a pro-Russian political party in Ukraine that authorities shut down after Russia launched its invasion in late February. He was on the run after having escaped house arrest in Kyiv, Ukraine’s capital, days after the war began. He was being held on treason charges.

In Donbas, Russian forces launched a major offensive Saturday on the remaining Ukrainian-held territory in the eastern province of Luhansk, Ukrainian officials said.

The renewed offensive in Severodonetsk was aimed at expanding the territory already under control of a Russian-backed separatist government that calls itself the Luhansk People’s Republic.

Officials said Russian forces maintained a control line to the east side of the Inhulets River following efforts to destroy a bridge crossing to prevent Ukrainian advances.

Capturing Luhansk and Donetsk provinces, much of which make up Ukraine’s industrial Donbas region, would allow Moscow to claim a victory after announcing last month that this was now its objective.

Speaking in the Russian-controlled part of Donetsk on Saturday, Mr. Slutsky, who is a member of Russia’s negotiating team in the stalled peace talks with Ukraine, said he expects the Luhansk and Donetsk people’s republics to determine their political futures like Crimea in the coming months, according to Russian state news agency TASS.

Russia annexed Crimea after pushing through a referendum that the United Nations deemed invalid. Mr. Putin recognized the Luhansk and Donetsk republics before sending Russian troops into Ukraine in February.

In an interview with The Wall Street Journal in his Kyiv office earlier in the week, Maj. Gen. Kyrylo Budanov, one of the architects of Ukraine’s war effort, said Ukraine urgently needs medium- and long-range missile systems, large-caliber artillery and strike aircraft to offset Russian advantages in manpower and equipment as it mounts a counteroffensive.

Gen. Budanov said Ukraine would keep fighting until it evicts Russian forces from all of its territory.

“I don’t know any borders except the borders of 1991,” Gen. Budanov said, referring to the year of Ukraine’s independence from the Soviet Union. “Who can force Ukraine to freeze the conflict? This is a war of all Ukrainians, and if someone in the world thinks that they can dictate to Ukraine the conditions under which it can or cannot defend itself, then they are seriously mistaken.”

In the northeast, the governor of Ukraine’s Kharkiv region said Russian forces continued to fire on the towns of Oleksiyivka and Saltivka, and a market in the city of Kharkiv was on fire due to missile strikes.

Mr. Zelensky has condemned an airstrike that hit a cultural center in the Kharkiv region on Friday, describing the attack as “absolute evil, absolute stupidity.” Seven people were injured in that strike.

A Ukrainian serviceman in the Kharkiv-area village of Ruska Lozova. Despite recent gains for Ukraine, the region is still coming under attack.

Photo: Manu Brabo for The Wall Street Journal

Meanwhile in Kyiv, the first trial of a Russian soldier in Ukraine was under way. Mr. Zelensky said on his official Telegram channel that Ukraine “will find and bring to justice all those who give and carry out criminal orders.”

Ukraine is set to receive another tranche of aid from the U.S. after President Biden on Saturday signed a nearly $40 billion package of financial and military support. The legislation, approved by the Senate on Thursday, includes provisions such as supplies and training for Ukrainian forces, humanitarian aid for refugees and economic assistance for Ukraine’s government.

In Russia, the head of Russia’s space agency, Roscosmos, said it would begin delivering new Sarmat intercontinental ballistic missiles to the Russian armed forces in the autumn. Russia says the missile can hit targets anywhere in the world.

Mr. Putin said while overseeing its first test-launch last month that it would make those threatening his country “think twice.”

Write to Vivian Salama at vivian.salama@wsj.com and Evan Gershkovich at evan.gershkovich@wsj.com