Russia attacked Ukraine with several waves of missiles on Saturday morning, the Ukrainian military said, putting the entire country under an air-raid alert and sending people rushing for shelter as bangs were heard in several cities.

The attack, which started around 5 a.m. local time and lasted about three hours, involved nearly 40 cruise and hypersonic missiles fired from different regions, including the Russian-occupied peninsula of Crimea and the Caspian Sea, to the southeast of Ukraine. They were directed at cities including Kyiv, the capital, and Lviv, near the border with Poland.

It followed Russia’s recent strategy for large-scale air assaults: waves of different types of aerial weapons launched almost simultaneously from multiple locations and aimed at various targets, with the goal of overwhelming Ukrainian air defenses.

The Ukrainian Air Force said that it had shot down eight missiles — a low interception rate compared with previous assaults — but that more than 20 other missiles and drones had missed their targets because of electronic jamming. The claims could not be independently verified.

The assault appeared to be part of an air campaign that Russia began in late December, targeting industrial and military infrastructure, and repeatedly hitting civilian areas in the process. President Volodymyr Zelensky of Ukraine has said that Moscow launched about 500 missiles and drones against his country in attacks around the New Year’s holidays.

On Saturday, local authorities reported explosions, some of which may have been caused by Ukrainian air defenses, in cities such as Kremenchuk and Kropyvnytskyi in central Ukraine. Oleksiy Kuleba, the deputy head of Ukraine’s presidential office, said that the “mass attack” had caused damage to civilian buildings in three regions, but that there had been no casualties.

A few hours after air-raid sirens stopped wailing in Kyiv, Stéphane Séjourné, France’s newly appointed foreign minister, arrived there for his first trip abroad, in a visit aimed at showing the West’s continued support amid concerns that Ukraine’s allies are growing tired of a protracted war.

“France’s help is a long-term commitment,” Mr. Séjourné, who is expected to meet with Mr. Zelensky in the afternoon, said on social media. The day before, Prime Minister Rishi Sunak of Britain visited Kyiv, pledging more than $3 billion in military aid to Ukraine in the next financial year and signing a bilateral security agreement.

Saturday’s attack was the fourth large-scale nationwide assault against Ukraine in about two weeks. In the previous attack, on Monday, Ukraine said it had intercepted only about a third of the missiles launched against its territory. Military analysts said that was a sign that Ukraine is running short of the surface-to-air missiles required to shoot down incoming Russian missiles.

“We lack modern air defense systems badly,” President Zelensky acknowledged during a trip to Lithuania on Wednesday.

Ukrainian officials said in the fall that Russia had stockpiled more than 800 high-precision missiles in preparation for huge attacks designed to wear down Ukrainian defenses.

In the three previous large air assaults against Ukraine, Russia fired a total of over 270 missiles, including several of its hypersonic Kinzhal missiles, one of the most sophisticated weapons in Russia’s arsenal. The volume consumed Ukraine’s air defenses, leaving it more vulnerable to future attacks.

“Ukraine has expended a significant stock of missiles on these three attacks,” Yurii Ihnat, a spokesman for the Ukrainian Air Force said on national television on Tuesday. “Therefore, there is a shortage of antiaircraft guided missiles, and no one hides it.”

The dearth of air defenses means that Ukraine has to divide resources between the front line and cities far from the fighting, leaving some places less well defended than others.

Ukraine, lacking the capacity to produce air defense systems domestically, depends on its Western allies for supplies to protect its skies. On his visit to the Baltic States on Wednesday and Thursday, Mr. Zelensky urged the United States and the European Union to release further aid packages.

Air defense systems, he said, are “what we need the most.”