A former UK government official has admitted Britain was caught spying when Russia exposed its use of a fake rock in Moscow to hide electronic equipment.
Russia made the allegations in January 2006, but this is the first time anyone in the UK has publicly accepted them.
Jonathan Powell, then Prime Minister Tony Blair's chief of staff, told a BBC documentary it was "embarrassing", but "they had us bang to rights".
He added: "Clearly they had known about it for some time."
They had been "saving it up for a political purpose", he said.
The story was first aired on Russian television, which ran a report showing how the rock contained electronic equipment and had been used by British diplomats to receive and transmit information.
It showed a video of a man walking along the pavement of a Moscow street, slowing his pace, glancing at a rock and slowing down, then picking up his pace. Next the camera films another man, who walks by and picks up the rock.
The Russian security service, the FSB, linked the rock with allegations that British security services were making covert payments to pro-democracy and human rights groups.
Shortly afterwards, then President Vladimir Putin introduced a law restricting non-governmental organisations (NGOs) from getting funding from foreign governments. Many closed down as a result.
"We have seen attempts by the secret services to make use of NGOs. NGOs have been financed through secret service channels. No-one can deny that this money stinks," said Mr Putin.
"This law has been adopted to stop foreign powers interfering in the internal affairs of the Russian Federation."
"All of our activities with the NGOs were completely above board," said Britain's ambassador in Moscow at the time, Tony Brenton.
"They were on our website, the sums of money, the projects. All of that was completely public."
One human rights group accused of receiving secret payments took the FSB to court for slander but lost.
"They said there was no slander and threw out the case," said Lyudmila Alexeyeva, head of the Moscow Helsinki Group.
The FSB successfully argued that the allegations did not represent slander as the secret payments showed the Moscow Helsinki Group was a "serious organisation".
The documentary series, Putin, Russia and the West, is on BBC Two on Thursdays at 21:00 GMT from 19 January 2012. Watch online afterwards via iPlayer (UK only) at the above link.