The barrister for alleged Russian spy Katia Zatuliveter has said MI5 were more like bumbling Inspector Clouseau than fictional spy hero George Smiley in their pursuit of her.
Tim Owen QC used the final day of an immigration hearing to attack the UK security service over its investigation of the former parliamentary researcher.
She is alleged to have been a "honey-trap" for MP Mike Hancock, 65.
A ruling on whether Ms Zatuliveter will be deported is expected next month.
The Special Immigration Appeals Commission hearing in London heard that MI5 had not tested the authenticity of a diary which Ms Zatuliveter submitted to them.
The hearing also heard that the document seems to corroborate how she felt about the MP, who had also become her lover shortly after the pair met in April 2006.
Mr Owen said: "On any view it reveals an extraordinarily poor investigative approach, more akin to Inspector Clouseau than George Smiley."
He attacked the inexperience of the agents who worked on the investigation - with one accepting she was "pretty green" and was learning "on the job", while another was introduced whose "sole function is to explain and bolster the security service case".Monthly payments
Meanwhile, the senior judge hearing the case has questioned the strength of the case against Ms Zatuliveter.
Mr Justice Mitting said if her private diary was to be believed, then there were doubts that she had been signed up by Russian intelligence while at university in St Petersburg - as the British government believes.
The security services believe her diary is possibly fake and written to lend her story credibility, but the judge said it was "a weakness in the home secretary's case" that the diary's authenticity had not been established.
If it had been written later to cover Ms Zatuliveter's tracks, then it "was a work of considerable skill" he added, also saying that the diary contained writings "of a highly personal nature" about her relationship with the then 60-year-old MP.
Continue reading the main story
End Quote Tessa Gregory Solicitor
During the course of these proceedings [Katia Zatuliveter] has provided the court and the home secretary with an overwhelming amount of evidence to explain every aspect of her life in minute detail”
In them she recorded how he had given her up to £500 a month when she first came to Britain. In one passage, she had written about worries that he had not called her. In another she wrote "at long last I will see my love after a long separation".
Mr Hancock was said by the security services to have been the target of a Russian honey-trap operation - Ms Zatuliveter also had a sexual relationship with a Dutch diplomat and high ranking NATO official.
An MI5 officer had told the hearing that it was "regrettable" the diary had not been more thoroughly examined as part of the security services spy hunt. Ink tests
Mr Justice Mitting said if the diary entries dated from the time she was beginning her relationship with Mr Hancock, who was a member of the defence commons select committee at the time, then "it's simply a matter of ordinary human understanding, but it's highly unlikely she'd been recruited to target Mike Hancock".
Lawyers for Ms Zatuliveter said they had located an expert in America who had a method for accurately dating handwriting based on changes over time in the ink that had been used.
But with tests expected to cost about £14,900 ($24,000) they would not be funded by the legal services commission. And the defence also said it was up to the Home Office to carry out the tests if they believed the diaries were fakes.
The counsel for the Home Office said it maintained that the diaries did not prove Ms Zatuliveter was not a Russian agent.
The commission was also asked if it would give a verbal indication of its decision on whether or not to quash the deportation order at the conclusion of the hearing on Friday.
Mr Justice Mitting replied that the judges could only give a ruling with a written reasoning for the decision, which could not be expected before the end of November.
Speaking after the proceedings ended, Ms Zatuliveter's solicitor, Tessa Gregory, said her client had never been a Russian spy, and had maintained throughout that she was entirely innocent of the allegations against her.
"During the course of these proceedings she has provided the court and the home secretary with an overwhelming amount of evidence to explain every aspect of her life in minute detail," Ms Gregory said.