Darja Stefancic, a painter in Slovenia known for technicolor landscapes, thought it strange when an obscure online art gallery run by a woman from Argentina contacted her out of the blue and asked her to join its thin roster of artists.

The painter suspected a scam, and she worried that the gallery, which virtually nobody in Slovenia’s tiny, tight-knit art scene had heard of, “just wanted to cheat people.”

It did — but in ways that far surpassed even her darkest suspicions.

The online gallery was a front for Russian intelligence, part of an elaborate network of deep-cover sleeper spies trained to impersonate Argentines, Brazilians and other foreign nationals by Russia’s foreign intelligence agency, the SVR, around Europe.

They were real-life versions of the fictional stars of “The Americans,” a television series inspired by the 2010 arrest of a ring of actual Russian sleeper agents in the United States.

Russia, and before it the Soviet Union, has a long history of investing heavily in so-called “illegals,” spies who burrow deep into target countries over many years. Unlike “legal” spies operating under diplomatic cover in Russian embassies, they have no immunity from prosecution or obvious connections to Russia and are extremely hard to detect.

Vladimir V. Putin, Russia’s president and a former K.G.B. officer, “has thrown huge resources at this quite eccentric priority,” said Calder Walton, the director of research for the Intelligence Project at Harvard’s Kennedy School. “He has a real fetish for illegals going back to his time in the K.G.B.”