The spokeswoman warned: "Our stance is straightforward: we will stick up for our own. They [Britain] will get as good as they give."
Alexander Yakovenko, Russia's ambassador to the UK at the time, quoted Sergey Lavrov, the foreign minister, saying: "Never do to others what you don't want them to do to you."
Western security officials have warned of Russia's increasing use of cyber-attacks, which have included the hacking of Democratic Party emails in the run-up to the American election.
Analysts suggested that the Sherlock leak could form part of Russia's threatened retaliation against the BBC.
Ben Nimmo, information defence fellow at the Atlantic Council think tank, said: "As Sherlock Holmes said himself, 'When you've eliminated the impossible, whatever remains, however improbable, must be the truth'.
"There appears to be no profit motive, no benefit to the broadcaster from doing this. What remains is a political motive. The most obvious explanation is that this is punitive."
Another Russia analyst, Lilit Gevorgyan, senior economist at IHS Global Insight, said: "There has been a pattern of Russia making short term tactical gains at the expense of long-term strategic losses, so we cannot entirely exclude the possibility that this is a deliberate act.
"But it would be so damaging, one has to question whether it would be worth it. So it could be a simple case of poorly executed intellectual property handling."
Sherlock is one of the BBC's biggest international success stories. The corporation recently revealed that the 2015 festive special, The Abominable Bride, was its biggest overseas export of the last financial year, selling to 216 territories across the world.
The corporation is understood to have upgraded its file security after scripts and unfinished footage from Doctor Who leaked from the Miami office of BBC Worldwide in 2014.
A source at the corporation said: "We have brought everything up to beyond gold standard, which is why things like this are so surprising. This is more than an accident."
The broadcaster is understood to be working with Channel One in Russia to work out how the Sherlock episode found its way online.
A spokesman said: "BBC Worldwide takes breaches of our stringent content security protocols very seriously and we have initiated a full investigation into how this leak has occurred."
Russia's Channel One did not return requests for comment.
* This story first appeared on The Telegraph.