As scores of supporters cheered for embattled Ukraine at a rally on the Philadelphia Art Museum steps last month, a small scene of street theater played out on the sidewalk below:

A man in a Vladimir Putin mask, holding down a person draped in a blue-and-yellow Ukrainian flag.

The symbolism was obvious amid the day’s loud denunciations of Russia’s threatened invasion of its neighbor. But it turns out the man who portrayed the Russian dictator is himself … Russian.

“I’m a bad Russian,” said Alexander Kashapov, 42, who came to Philadelphia from Moscow five years ago. “To be Russian doesn’t mean to support everything Russia does.”

In Eastern Europe, the lines between Ukraine and Russia are now firmly drawn, with 100,000 Russian troops massed on the borders. In the Philadelphia region, the allegiances among people whose heritage lies in those lands can be unexpected, the relationships complex and tempered by the continuing impact of historic conflicts and struggles.

“Both in the Ukrainian and the Russian community, there’s a wide range of opinions on all these issues,” said Mary Kalyna, a Ukrainian American activist in Mount Airy who helped organize the “Philly Stands With Ukraine” rally Jan. 30. “We always have to be distinguishing between what the government is doing and what people are doing and saying.”

Today 15,245 Ukrainian immigrants make their homes in Philadelphia and the surrounding suburban and South Jersey counties, along with 8,818 Russian immigrants.

An additional 54,324 people claim Ukrainian ancestry, while 89,422 cite Russian heritage.

People in both communities often share the Russian language. They often share conservative politics. And it can seem as if everyone, whether one’s heritage springs from Russia, Ukraine, Armenia, Georgia, Lithuania, or another nearby nation, shops at locally owned Bell’s Market in Northeast Philadelphia, known for its authentic East European and international selections.

“We don’t have any kind of problem with the Russian people,” said Eugene Luciw, president of the Philadelphia branch of the Ukrainian Congress Committee of America. “We feel they’ve been sold a bad bill of goods.”

Ukrainians here are well-organized, represented in groups like the Ukrainian League of Philadelphia and in institutions such as the Ukrainian Educational and Cultural Center in Jenkintown and the Ukrainian Selfreliance Federal Credit Union in Feasterville.

Russian heritage organizations are fewer. The Congress of Russian Americans, the national nonprofit group in California, has no chapters in the Philadelphia region. No one wanted to comment at the Russian Brotherhood Association in Yardley, which provides insurance, scholarships, and other benefits to members.

Many of the Russians in this region came to escape Putin — or the Soviet Union before him.

Soviet famines killed millions of Ukrainians in the early 1920s and again in the early 1930s, and the cruelties and losses of World War II shaped families for generations. Those hardships are not forgotten.

At the same time, immigration is the great leveler. Newcomers find that confronting the daily challenges of American society is plenty to handle.

“We’re all immigrants,” said Siarzhuk Shaliga, 46, of Bucks County, who arrived in 1999 from Belarus.

The pharmaceutical company manager said he sought liberties and freedoms that did not exist in Belarus, the close Russia ally.

Today he’s a leader in the Association of Belarusians in America, a cultural group. His mother still lives in Belarus, where Russia deployed thousands of troops to conduct military exercises on the Ukrainian border.

Like other local immigrants from that region, Shaliga fears the outbreak of war, its possible spread, and the danger that portends for loved ones there.

“Belarusians and Ukrainians, we fight for slightly different matters,” he said, noting that Ukraine is closer to the Western powers. “Of course they’re fighting for their life now.”

Western government officials say that they don’t know if Putin has decided to attack but that on Ukraine’s borders he’s assembled nearly all of the soldiers and weapons needed for invasion. President Joe Biden said he has no intention of sending U.S. troops into Ukraine but has threatened severe economic sanctions against Russia and members of Putin’s inner circle.

The Biden administration intends to deploy 3,000 troops to Poland, Germany, and Romania to support NATO allies in the region.

Ukraine does not belong to NATO, which links mostly Western nations in a mutual-defense pact. Russian officials deny any plans for invasion and blame the Western powers for causing tensions in the region.

Julia Kirillova immigrated to the United States from Russia in 1994, her family roots in Moscow and Siberia. In summer she painted her toenails Ukrainian blue and yellow, to show support in the face of that nation’s wider, eight-year conflict with Russia over the seizure of Crimea.

“It’s like a shame over all of us,” said Kirillova, a nurse who lives in Bala Cynwyd. “When asked, I still say I’m Russian, because I want people to know that not all Russians think like Putin.”

The dictator’s declaration that Russians and Ukrainians constitute one people, one nation of brothers, rankles Kalyna, the rally organizer.

“You don’t invade your brother,” she said.

For her and others, the losses of World War II and the subsequent Soviet-era repressions are still fresh. The front line came through her family village three times, as Russians and Germans fought for territory.

Her father fought the Nazis and then the Soviets in an underground movement for Ukrainian independence, she said.

At war’s end he was in a displaced-persons camp in Germany. When the Soviets couldn’t get their hands on him and others they accused, they punished their families. In 1947 her father’s parents were sent to Siberia, where people died in droves in labor camps.

His mother did not survive. His father was released years later.

Kalyna said that after her father died, she found an important memento, the only surviving photo of his mother, her grandmother.

“I’m the daughter of this tragedy,” she said. “This happened to a lot of families.”

Kashapov, the activist in the Putin mask, said he doesn’t understand why people are talking about the possibility of Russian invasion. It already happened, he said, eight years ago, when Russia took Crimea from Ukraine.

“If the invader comes to our house and only stays in the living room, we can’t think this is normal,” he said. “People who care about protecting weak from strong, they have to act now.”

Graphics editor John Duchneskie contributed to this article.