KYIV, Ukraine—Fighting between Russian and Ukrainian forces has reached the streets of the port city of Mariupol, officials said Saturday, a strategic objective for Moscow as it attempts to open an overland corridor to the annexed region of Crimea and shift the momentum in its three-week-old invasion.

During weekslong bombardment and attack, Ukrainians said they had kept Russian forces at bay on Mariupol’s outskirts, but that has changed. “The fighting is already in the city itself,” an official from the mayor’s office said via text message. “But Mariupol remains a Ukrainian city.”

Government forces in Ukraine said they kept up the resistance Saturday. “Fierce battles between the defenders of Mariupol and the occupier continue, including on the city streets,” said a report on the Telegram channel of the volunteer group Azov Battalion, whose members have been fighting alongside regular government forces inside the city.

“The military is repulsing the enemy, which isn’t stopping its attack on Mariupol with artillery and aircraft,” the report said.

The capture of Mariupol would be a victory for Russia, which has so far failed to take any big Ukrainian cities since the start of its invasion. A bustling southern port with a major metals plant, Mariupol straddles an east-west thoroughfare coveted by the Kremlin as a possible link between Russia’s mainland and Crimea, which it seized from Ukraine in 2014. Since then, the peninsula has been blockaded by Ukraine, and its main link to Russia is a 12-mile-long bridge hastily started by Russia in 2014 and completed four years later.

“This would potentially strengthen Russian forces’ ability to resupply, to operate from a more secure base, and to project forces farther into Ukraine,” said Barry Pavel, a former Pentagon and National Security Council official now at the Atlantic Council think tank.

Russia anticipated a speedy capture of Mariupol, a traditionally Russian-speaking city, that would have freed up its forces to encircle Ukrainian army units in eastern regions and allow others to push further toward the Ukrainian capital of Kyiv. But the city has been a hard target, and its defenders have endured weeks of shelling and siege.

A boy in a Ukrainian children’s hospital. He was wounded when his family car came under attack by Russian forces.

Photo: Christopher Occhicone for The Wall Street Journal

Russian military leaders have been desperate for a symbolic victory to offer President Vladimir Putin, analysts say, and U.S. officials have detected indications of tension in the Russian intelligence and defense apparatuses over the lack of military progress.

“The commanders on the Russian side have to be desperate for a ‘win’—they want to show Putin results,” said Emily Harding, a former CIA analyst and Senate Intelligence Committee staff member now at the Center for Strategic and International Studies think tank in Washington. “Conquering Mariupol would give them something to show for the heavy losses they’ve taken.”

In the southern city of Mykolaiv, Russian missile strikes hit the headquarters of the Ukrainian army’s 79th brigade, including the quarters where officers’ families live. Several buildings collapsed and footage from the scene, broadcast on Ukrainian television channels, showed a small child being dug out from the rubble. Ukrainian officials say 40 people, and possibly more, have been killed.

Vitaliy Kim, the governor of Mykolaiv, said in a video recording that the “cowardly” Russian strike targeted sleeping soldiers, and that rescue operations at the site are under way. The Ukrainian military counteroffensive in the region is pressing ahead, he added.

As Russian forces have pounded Mariupol with airstrikes and artillery, the city has emerged as a symbol of tough Ukrainian resistance, as well as civilian suffering. Thousands of the city’s 400,000 population have fled, and thousands have been killed, some dumped into mass graves, officials said.

On Saturday, some of the fighting focused around the massive Azovstal steel plant, inside the western border of the city. The company said the plant was shelled by Russian artillery Saturday, forcing a shutdown in operations.

Kyiv has tried to relieve Mariupol, so far unsuccessfully. Oleksiy Arestovych, an adviser to Ukraine’s president, said there was no way for Ukrainian forces to break Russia’s siege, addressing criticism the government isn’t doing enough.

Mariupol’s proximity to the Russian border means Moscow could easily bring massive air power to bear on it from nearby military hubs, such as Crimea and the southern Russian city of Rostov, he said.

The closest Ukrainian units to Mariupol are more than 100 kilometers, or 62 miles, away, he said, and the vast treeless steppe around the city provides no cover from Russian attacks.

“No army in the world—even the U.S.—would make it that distance with the forces that we currently have there, unfortunately,” Mr. Arestovych said.

A handout image taken on Saturday showed the aftermath of an airstrike on a theater in Mariupol.

Photo: Maxar Technologies/Agence France-Presse/Getty Images

Ukraine’s President Volodymyr Zelensky said in his overnight address that 9,000 people have been evacuated from the city. Rescuers in Mariupol pulled 130 people from the wreckage of a theater hit by an airstrike this week and searched for more survivors.

About 1,300 people remained trapped Friday in the basement of the theater, where residents had sought shelter from Russian shelling, said Lyudmyla Denisova, Ukraine’s human-rights commissioner, adding that it was difficult to be certain of the number of survivors. She didn’t confirm any casualties.

Parts of the Russian offensive have been bogged down by poor planning and logistics, and forces have encountered fierce Ukrainian counterattacks. Some of Russia’s ground advances stalled this week amid mounting casualties. Four Russian generals have died, the Ukrainian government said. Some U.S. government calculations estimate as many as 7,000 Russian troops have been killed in action, though officials caution those are uncertain estimates.

“They continue to make incremental gains,” U.S. Defense Secretary Lloyd Austin said Saturday in Bulgaria of Russian forces’ progress in southern Ukraine.

Ukrainian soldiers carried a dead soldier in Mykolaiv on Saturday.

Photo: bulent kilic/Agence France-Presse/Getty Images

A Ukrainian soldier is rescued from the debris of a military school hit by a Russian strike in Mykolaiv.

Photo: bulent kilic/Agence France-Presse/Getty Images

Yet, Moscow has been showcasing some of its high-tech weaponry with long-distance missile strikes. The Russian Defense Ministry said Saturday it fired an air-launched ballistic missile on Ukraine in what might have been the first use of the system Mr. Putin announced several years ago.

The weapon struck a large underground warehouse of missiles and aviation ammunition near Deliatyn in western Ukraine, the ministry said. Russian state media, RIA Novosti, said it was the first use of the new weapon.

Western and Ukrainian military experts cast doubt on whether Russia in fact used such a sophisticated weapon. Yuriy Ignat, spokesman for the Air Force of the Armed Forces of Ukraine, Ukraine’s military, confirmed a strike on the facility but said there was no information yet on the number of casualties or the type of weapon used.

“Unfortunately, Ukraine has become a testing ground for Russia’s entire arsenal of missiles,” said Mr. Ignat. “They use missiles that fly 2,000 kilometers, 5,500 kilometers.”

Residents and volunteers clean up the destruction caused by a rocket attack in Kyiv.

Photo: Christopher Occhicone for The Wall Street Journal

Mr. Zelensky said Russian forces “continue to block the supply of humanitarian aid to the besieged cities in most areas,” aside from the seven open humanitarian corridors. He added that more than 180,000 Ukrainians have been rescued and tons of essential supplies have been delivered. He also dropped all taxes and customs duties in an effort to expedite cargo entering the nation.

Mr. Zelensky called on Russia to negotiate and said that in the coming days he would address other nations like Switzerland, Israel, Italy and Japan, just like he did the U.S., Canada and Germany. “It’s time to meet. Time to talk. It is time to restore territorial integrity and justice for Ukraine,” he said. “Otherwise, Russia’s losses will be so huge that several generations won’t be enough to rebound…Ukraine’s proposals are on the table.”

Write to Alan Cullison at alan.cullison@wsj.com and Isabel Coles at isabel.coles@wsj.com