KYIV, Ukraine — Since Russia began its invasion of Ukraine last year, the Ukrainian government and NATO allies have posted, then quietly deleted, three seemingly innocuous photographs from their social media feeds: a soldier standing in a group, another resting in a trench and an emergency worker posing in front of a truck.

In each photograph, Ukrainians in uniform wore patches featuring symbols that were made notorious by Nazi Germany and have since become part of the iconography of far-right hate groups.

The photographs, and their deletions, highlight the Ukrainian military’s complicated relationship with Nazi imagery, a relationship forged under both Soviet and German occupation during World War II.

That relationship has become especially delicate because President Vladimir V. Putin of Russia has falsely declared Ukraine to be a Nazi state, a claim he has used to justify his illegal invasion.

Ukraine has worked for years through legislation and military restructuring to contain a fringe far-right movement whose members proudly wear symbols steeped in Nazi history and espouse views hostile to leftists, L.G.B.T.Q. movements and ethnic minorities. But some members of these groups have been fighting Russia since the Kremlin illegally annexed part of the Crimea region of Ukraine in 2014 and are now part of the broader military structure. Some are regarded as national heroes, even as the far-right remains marginalized politically.

The iconography of these groups, including a skull-and-crossbones patch worn by concentration camp guards and a symbol known as the Black Sun, now appears with some regularity on the uniforms of soldiers fighting on the front line, including soldiers who say the imagery symbolizes Ukrainian sovereignty and pride, not Nazism.

In the short term, that threatens to reinforce Mr. Putin’s propaganda and giving fuel to his false claims that Ukraine must be “de-Nazified” — a position that ignores the fact that Ukraine’s president, Volodymyr Zelensky, is Jewish. More broadly, Ukraine’s ambivalence about these symbols, and sometimes even its acceptance of them, risks giving new, mainstream life to icons that the West has spent more than a half-century trying to eliminate.

“What worries me, in the Ukrainian context, is that people in Ukraine who are in leadership positions, either they don’t or they’re not willing to acknowledge and understand how these symbols are viewed outside of Ukraine,” said Michael Colborne, a researcher at the investigative group Bellingcat who studies the international far right. “I think Ukrainians need to increasingly realize that these images undermine support for the country.”

In a statement, the Ukrainian Defense Ministry said that, as a country that suffered greatly under German occupation, “We emphasize that Ukraine categorically condemns any manifestations of Nazism.”

So far, the imagery has not eroded international support for the war. It has, however, left diplomats, Western journalists and advocacy groups in a difficult position: Calling attention to the iconography risks playing into Russian propaganda. Saying nothing allows it to spread.

Even Jewish groups and anti-hate organizations that have traditionally called out hateful symbols have stayed largely silent. Privately, some leaders have worried about being seen as embracing Russian propaganda talking points.

Questions over how to interpret such symbols are as divisive as they are persistent, and not just in Ukraine. In the American South, some have insisted that today, the Confederate flag symbolizes pride, not its history of racism and secession. The swastika was an important Hindu symbol before it was co-opted by the Nazis.

In April, Ukraine’s Defense Ministry posted a photograph on its Twitter account of a soldier wearing a patch featuring a skull and crossbones known as the Totenkopf, or Death’s Head. The specific symbol in the picture was made notorious by a Nazi unit that committed war crimes and guarded concentration camps during World War II.

The patch in the photograph sets the Totenkopf atop a Ukrainian flag with a small No. 6 below. That patch is the official merchandise of Death in June, a British neo-folk band that the Southern Poverty Law Center has said produces “hate speech” that “exploits themes and images of fascism and Nazism.”

The Anti-Defamation League considers the Totenkopf “a common hate symbol.” But Jake Hyman, a spokesman for the group, said it was impossible to “make an inference about the wearer or the Ukrainian Army” based on the patch.

“The image, while offensive, is that of a musical band,” Mr. Hyman said.

The band now uses the photograph posted by the Ukrainian military to market the Totenkopf patch.

The New York Times asked the Ukrainian Defense Ministry on April 27 about the tweet. Several hours later, the post was deleted. “After studying this case, we came to the conclusion that this logo can be interpreted ambiguously,” the ministry said in a statement.

The soldier in the photograph was part of a volunteer unit called the Da Vinci Wolves, which started as part of the paramilitary wing of Ukraine’s Right Sector, a coalition of right-wing organizations and political parties that militarized after Russia’s illegal annexation of Crimea.

At least five other photographs on the Wolves’ Instagram and Facebook pages feature their soldiers wearing Nazi-style patches, including the Totenkopf.

NATO militaries, an alliance that Ukraine hopes to join, do not tolerate such patches. When such symbols have appeared, groups like the Anti-Defamation League have spoken out, and military leaders have reacted swiftly.

Last month, Ukraine’s state emergency services agency posted on Instagram a photograph of an emergency worker wearing a Black Sun symbol, also known as a Sonnenrad, that appeared in the castle of Heinrich Himmler, the Nazi general and SS director. The Black Sun is popular among neo-Nazis and white supremacists.

In March 2022, NATO’s Twitter account posted a photograph of a Ukrainian soldier wearing a similar patch.

Both photographs were quickly removed.

In November, during a meeting with Times reporters near the front line, a Ukrainian press officer wore a Totenkopf variation made by a company called R3ICH (pronounced “Reich”). He said he did not believe the patch was affiliated with the Nazis. A second press officer present said other journalists had asked soldiers to remove the patch before taking photographs.

Ihor Kozlovskyi, a Ukrainian historian and religious scholar, said that the symbols had meanings that were unique to Ukraine and should be interpreted by how Ukrainians viewed them, not by how they had been used elsewhere.

“The symbol can live in any community or any history independently of how it is used in other parts of Earth,” Mr. Kozlovskyi said.

Russian soldiers in Ukraine have also been seen wearing Nazi-style patches, underscoring how complicated interpreting these symbols can be in a region steeped in Soviet and German history.

The Soviet Union signed a nonaggression pact with Germany in 1939, so it was caught by surprise two years later when the Nazis invaded Ukraine, which was then part of the Soviet Union. Ukraine had suffered greatly under a Soviet government that engineered a famine that killed millions. Many Ukrainians initially viewed the Nazis as liberators.

Factions from the Organization of Ukrainian Nationalists and its insurgent army fought alongside the Nazis in what they viewed as a struggle for Ukrainian sovereignty. Members of those groups also took part in atrocities against Jewish and Polish civilians. Later in the war, though, some of the groups fought against the Nazis.

Some Ukrainians joined Nazi military units like the Waffen-SS Galizien. The emblem of the group, which was led by German officers, was a sky-blue patch showing a lion and three crowns. The unit took part in a massacre of hundreds of Polish civilians in 1944. In December, after a yearslong legal battle, Ukraine’s highest court ruled that a government-funded research institute could continue to list the unit’s insignia as excluded from the Nazi symbols banned under a 2015 law.

Today, as a new generation fights against Russian occupation, many Ukrainians see the war as a continuation of the struggle for independence during and immediately after World War II. Symbols like the flag associated with the Ukrainian Insurgent Army and the Galizien patch have become emblems of anti-Russian resistance and national pride.

That makes it difficult to easily separate, on the basis of icons alone, the Ukrainians enraged by the Russian invasion from those who support the country’s far-right groups.

Units like the Da Vinci Wolves, the better-known Azov regiment and others that began with far-right members have been folded into the Ukrainian military, and have been instrumental in defending Ukraine from Russian troops.

The Azov regiment was celebrated after holding out during the siege of the southern city of Mariupol last year. After the commander of the Da Vinci Wolves was killed in March, he received a hero’s funeral, which Mr. Zelensky attended.

“I think some of these far-right units mix a fair bit of their own mythmaking into the public discourse on them,” said Mr. Colborne, the researcher. “But I think the least that can and should be done everywhere, not just Ukraine, is not allowing the far right’s symbols, rhetoric and ideas to seep into public discourse.”

Kitty Bennett and Susan C. Beachy contributed research.