Shadowy world of batting foreign spies pokes into view in a seemingly unlikely corner of the Eastern Shore.

The decision of the Obama administration this week to shut down a Russian diplomatic compound on the Eastern Shore cast a small patch of light on the normally shadowy job of battling foreign spies on U.S. soil.

President Barack Obama said the Russians were using the 46-acre estate outside Centreville to gather intelligence on the United States.

Russian officials have described the property, home to a Gilded Age mansion, a cluster of cottages, tennis courts and a swimming pool, as a retreat for Russian diplomats and their families.

On Friday, television cameras captured a convoy of trucks whipping down the road away from the estate.

The existence of the compound wasn't a secret. The U.S. State Department owned an office building next door.

But shutting it down on Thursday — in response, Obama said, to Russian meddling in the U.S. presidential election — answered a question intelligence operatives face routinely: When do you move against an adversary, and risk revealing what you know about its activities, and when do you let the adversary keep working, and quietly keep it under watch?

While shutting an operation down could send a message to the Russian government, former FBI agent David C. Gomez said, it could also make it more difficult for American counter-intelligence agents to keep tabs on what Russia is doing.

"The knowledge that they use it gives the FBI and gives the government a head start on trying to counter whatever they're doing," Gomez said. "It's a bit like playing a football game and knowing what the opponent's overall game plan is."

It's widely known that Russia spies on the United States — and that the United States spies on Russia. Some degree of espionage is tolerated; the FBI tries to keep a close eye on which supposed Russian diplomats are actually spies, and block their efforts to siphon secrets out of the country.

But in recent years, tensions between the two countries have run particularly high.

The administration moved against Russia Thursday in retaliation for what the U.S. intelligence community has concluded was a concerted effort to interfere in the election. Russian operatives are suspected of hacking into the computers of the Democratic National Committee and Hillary Clinton's campaign chairman and leaking private messages through Wikileaks and other websites.

Senior U.S. intelligence officials have said hacking into computers in search of information is generally fair game, but spreading the information publicly represented a provocative new turn.

The Obama administration imposed sanctions on Russian officials and organizations it says were linked to the hacking. It also ordered 35 suspected Russian intelligence operatives out of the country, and shuttered two Russian properties, one on Long Island in New York and the one on the Eastern Shore.

Russian President Vladimir Putin declined to respond in kind to the U.S. actions Friday. He instead adopted a magnanimous tone, declining a recommendation by his foreign minister to expel dozens of U.S. diplomats.

He invited the diplomats' children to attend lavish Orthodox Christmas festivities in the Kremlin and said he'd wait to deal with incoming U.S. President Donald J. Trump.

The future of the Russian properties is unclear. A State Department official said the department would control access to them, and take responsibility for their security and maintenance.

The properties will remain under Russian ownership, the official said.

Officials did not describe the role the properties are suspected of playing in Russian spying. While they might have housed gear for sweeping up American communications, they might also just have served as a place to hold sensitive discussions away from the prying eyes of the FBI.

Sen. Ben Cardin, the top Democrat on the Senate Foreign Relations Committee, said closing the Maryland facility and other steps were an appropriate response to the harassment of American diplomats in Russia.

"I welcome this strong message," Cardin said through a spokeswoman.

It's not clear whether the Trump administration will keep the estates mothballed. A senior Obama administration official acknowledged that a future president could change course.

"We think it would be inadvisable," said the official, one of several who briefed reporters on the condition that they not be named. "These diplomatic compounds were being used for intelligence purposes. That is a direct challenge to U.S. national security, and I don't think it would make much sense to reopen Russian intelligence compounds."

Local residents say the Russians were good neighbors.

When New England developer Peter Sheaffer bought about 1,700 acres of farmland next door in 1980, he didn't give much thought to who he'd be living beside. By then, the Soviet Union had owned the neighboring estate for nearly a decade.

Sheaffer said he became friendly with his neighbors, and would be invited over to summer parties.

"They're very nice people," said Sheaffer, 84. "What does this accomplish? It just accomplishes more hard feelings. We don't need to be going out and trying to make enemies."

When the Russian diplomat Anatoly Dobrynin was the Soviet ambassador to the United States in the 1980s, Scheaffer often saw him bicycling with his bodyguard on the rural roads around the estate. They would stop and chat.

"He'd be here almost every weekend," Sheaffer said.

On the opposite side to Sheaffer, the Russian property has a more curious neighbor: the 6,800-square-foot office building owned by the State Department.

The department did not respond to questions about the building's function. But former intelligence officials who have been there say it was used for meetings and had rooms to stay overnight.

But they conceded that it might also have served another useful function: keeping tabs on the comings and goings at the Russian estate.

"If I knew a Russian spy was living in the neighborhood," Gomez said, "I'd try to buy the house next door."

Baltimore Sun reporters Tim Prudente and John Fritze contributed to this article.