But despite the public air of national emergency, Operation Rain was in trouble. Intense police efforts here and in Britain were yielding nothing to implicate this man in the British outrages. Police had their suspicions. They had seized a huge amount of material to analyse. There were many interesting leads to follow. But after nearly a fortnight they had found nothing that would hold up in court. And they knew it. A document released to Haneef's lawyers under freedom of information shows a senior investigator with Operation Rain concluding at this time: "I do not believe that I currently have sufficient evidence to charge Haneef." ASIO was delivering the same verdict to the Government. Queensland police attached to Operation Rain also believed there was insufficient evidence to charge the man.

But three days later, at the end of an all-night interrogation, Haneef was charged under section 102.7(2) of the Commonwealth's Criminal Code with providing a SIM card to a terrorist organisation a year earlier and "being reckless as to whether the organisation was a terrorist organisation". How and why that charge was laid is the central question to be answered by John Clarke, QC, the former NSW Supreme Court judge now investigating the Haneef shemozzle. Haneef found his visa cancelled and facing the prospect of immigration detention and deportation. A mighty national controversy erupted. A fortnight later the then Commonwealth DPP Damien Bugg, QC, intervened to discontinue the charge. He too was "not convinced that the evidence establishes a reasonable prospect of conviction against Dr Haneef". Embarrassment, acrimony and blame-shifting followed. The AFP is still ladling it out in the submission to Clarke released this week. It is blaming the DPP for the charge ever being laid; Scotland Yard for supplying incorrect information; the DPP again for not publicly correcting crucial errors in police briefings; Haneef's legal team for releasing transcripts of his interrogation; and the press for too often getting the story wrong: "The erroneous reporting was not only unhelpful to Dr Haneef and the AFP, it was unfair to the Australian community who might reasonably have expected that accurate information on such an important issue was being made available to them."

Meanwhile, the AFP has been extremely reluctant to make basic information available. It has declined to release the full submissions plus witness statements and documents actually given to Clarke. No "UK-sourced information" has been released. A pile of documents obtained under FOI by Haneef's legal team are heavily redacted. But they - together with submissions to Clarke from the DPP, ASIO, the Queensland Police and even the AFP - allow a fairly complete answer to be given to the question: what on earth was going on here? In a nutshell: they never had anything concrete to link Mohammed Haneef to his cousin's crimes; they were never very interested in the SIM card; they were living all along in the hope that something damning would turn up in Britain. The mantra of Operation Rain and the hapless DPP official drawn into the police net was: something's on its way from over there. But it never came.

Two Mercedes-Benz cars packed with gas canisters, petrol and nails were parked in central London early in the morning of June 29 last year by Kafeel Ahmed and an accomplice. Police allege the second man was Dr Bilal Abdulla, an Iraqi diabetes specialist now on trial for this crime in Britain. The bombs failed to explode. The next day, the two men mounted a suicide ram raid on Glasgow airport. This, too, was a fiasco. The only casualty was Kafeel who later died of burns. On his way north, Kafeel had sent his brother, Dr Sabeel Ahmed, an email confessing his mission. British police and courts have accepted this jihad message as evidence that Sabeel knew nothing of his brother's plans. Haneef had left his SIM card with Sabeel in the summer of 2006 as he prepared to fly out to a new job and a new life in Australia. Sabeel was not a terrorist or the member of a terrorist cell. Giving him a SIM card could not assist - recklessly or otherwise - a terrorist organisation. The AFP has now admitted it knew of the jihad email but this critical information never reached Haneef's lawyers and was not given to the DPP before Haneef was charged. The AFP argues in its submission to Clarke that the email had to be tested to make sure it was not created to help mask Sabeel's "true knowledge" of the terrorists' plans. Despite the verdict of the British courts, the AFP's submission still does not clearly endorse the email as genuine.

Phone records alerted British police to Haneef's existence. Far from being useful as an untraceable component in a terrorist bomb, the SIM card revealed a connection between Haneef - in whose name the card remained registered - and his cousins Sabeel, who usually paid the fees, and Kafeel, who paid them once. With the help of some neighbours in Liverpool, England, and Sabeel's mother in India, British police then got a message through to Haneef at the Southport Hospital on the Gold Coast: please ring. He tried half a dozen times without success to get through to Scotland Yard's Tony Webster. These attempts punctuated a crowded day in which Haneef took leave from his job; had his father-in-law buy him a ticket home to Bangalore; left his car, laptop, documents and wife's jewellery for safekeeping with his colleague Dr Asif Ali; spoke several times to family members in India; and left for Brisbane airport where, a little before midnight, he was taken into custody.

The magistrate supervising Haneef's detention in the watchhouse never heard of those attempted calls to British police. But it was worse than that. Haneef's lawyers say in their submission to Clarke: "No public statement of which we are aware by any Australian agency has referred to this crucial information as a matter relevant to or taken into account by them in their decisions concerning Dr Haneef. The AFP's actions in respect of this information require the closest scrutiny by the inquiry." Police had many reasons to be suspicious. British police were "linking" this man to botched attempts at mass murder; he appeared to be doing a bunk; he had only an expensive one-way ticket; in his baggage were documents that seemed hardly useful on a seven-day dash home; and the sudden concern to see his newborn child seemed odd as the baby was by this time six days old. That the AFP needed to investigate Haneef is beyond dispute. The question is: did they have the right to detain him for nearly a fortnight without charge in the Brisbane watchhouse while they did so? At one point over the next few days, one of the police gave Haneef his snapshot view of the situation: they would hold him until they were absolutely certain he had had no part in the British bomb attempts. "We obviously investigate things to a point that we can say Mohammed's definitely not involved and we are happy and can categorically state that."

But Haneef's lawyers argue that this turns the law on its head. The AFP could only hold him without charge under the anti-terrorism provisions of the Criminal Code while officers had a "reasonable belief" that he had actually committed the crime for which he was detained: giving his SIM card to a terrorist cell. His lawyers say that certainly after the first day's interrogation - when Haneef gave his explanation for the issues concerning police - his continued detention was unlawful. The evidence wasn't there to sustain a "reasonable belief" in his guilt. "There was a duty … for the state of arrest to be brought to an end, and for Dr Haneef to be released." CLIVE PORRITT only heard about Haneef from the media. Porritt was the Commonwealth Director of Public Prosecutions' man in Brisbane. Normally, the AFP would bring him in at an early stage of such operations. Not this time. So Porritt rang the police on the first morning of Haneef's detention. The DPP's submission to Clarke states: "The officer said he appreciated [Porritt's] offer of assistance but did not have the time to talk further." Porritt checked again next day and was told, "The AFP did not anticipate this matter coming to court imminently."

Porritt was brought in on various bits and pieces of the case, but the DPP's man had no role in the central, controversial and untried system of judicial supervision of a suspect's detention. Essentially that meant the police asking magistrate Jim Gordon for extensions of time to hold their prisoner. The magistrate would never speak to Haneef. Police material handed to Gordon was full of errors. Little or nothing exculpatory was shown to the magistrate. Gordon was told time and again of the "enormity" of the task facing police. They always needed more time. A huge police operation in Britain and Australia was under way. Though heavily redacted, police documents obtained under FOI show the AFP was barely interested in the SIM card. Operation Rain's first priority was tracking down Haneef's petty but complex financial dealings - including payments to and from his terrorist cousin Kafeel of a few thousand dollars over the years. Police did not accept Haneef's claim that these were gifts or remittances through Kafeel to his own family in Bangalore. The question in Brisbane was: how much longer could they hold Haneef? With the encouragement of officers involved in his case, Haneef had hired a solicitor, Peter Russo, and he brought Stephen Keim, SC, onto the legal team. The balance was shifting. The lawyers were demanding to see some of the police material. So far they had seen none. Gordon gave police what they wanted on July 5, but on July 9 he rejected a request for 120 hours and granted only 48.

A fallback strategy was already in place. Plans were well advanced to cancel Haneef's visa and transfer him to immigration detention if the magistrate should order his release. This was not a last-minute exigency as it would later appear, but an integral part of the strategy all along. By whatever machinery was available, Haneef was to be kept locked up. July 11, when Gordon would be asked for the next extension of time, was looming as the showdown. In preparation, the AFP collated a summary of the facts. Clearly it did not make compelling reading. The author of a heavily redacted AFP document - probably the senior investigating officer of Operation Rain, Ramzi Jabbour - wrote: "Having reviewed the material in possession of the investigation team at this stage and assessed that against the offences outlined above, I do not believe that I currently have sufficient evidence to charge Haneef."

ASIO was delivering much the same conclusion on July 11 in written advice to "the Government and various agencies". In its submission to Clarke, ASIO says its inquiries had turned up nothing to show Haneef had foreknowledge of the British attacks. "Nor was there any information to indicate that Dr Haneef was undertaking planning for a terrorist attack in Australia or overseas." Keim was allowed to see some of the AFP documents handed to the magistrate that day. Tucked away in a sub-paragraph is the first admission that the SIM card was found, not at the scene of any of Kafeel's crimes, but with his brother in Liverpool. This correction of Scotland Yard's original advice appears to have made absolutely no difference to the AFP's approach to the case. Gordon gave the police another 48 hours. The showdown was postponed. Early next morning, the AFP Commissioner, Mick Keelty, rang the Commonwealth DPP Damien Bugg who was waiting to catch a plane at Melbourne airport. According to the DPP's submission to Clarke, Keelty remarked: "He did not think that at that stage of the investigation that there was a case against Dr Haneef."

Yet later that day in Brisbane, Clive Porritt was at last called in by Operation Rain to assess the case against the prisoner. He was shown a mass of material which he found "incomplete and unfocused" but there was enough there for him to tell police they could not charge Haneef with financing terrorism. It was the SIM card or nothing. Police promised to prepare a briefing paper overnight. Porritt spent most of the next day, July 13, at AFP headquarters digesting a 48-page brief that came with complex charts and statements. His superiors say they made it clear to him early that afternoon that he was not to approve a charge. If the police wanted to go down that track, it was to be on their head alone. But for reasons that are not clear in the DPP's submissions to Clarke, Porritt gave police what they wanted. He says he "felt an unspoken but extreme pressure to provide positive reassurance to police that they were lawfully entitled to charge Dr Haneef … It was a fraught and stressful time."

Porritt advised Haneef could be charged with intentionally providing "resources" - that is, the SIM card - to a terrorist organisation "consisting of a group of persons including Sabeel Ahmed and Kafeel Ahmed, being reckless as to whether the organisation was a terrorist organisation". By the time he confirmed his advice in writing about 6pm, the second long interrogation of Haneef was under way. It would go for 12 hours until abruptly terminated about 4.30am. To Haneef's barrister Keim it seemed the second examination showed how little headway the AFP had made in its investigations. The most interesting new material was a chatroom exchange in which a number of ambiguous statements were made by Haneef and his brother. Once again, this raised suspicions but fell way short of proof of any offence. About dawn, Haneef's interrogators and several Queensland police attached to Operation Rain met its commander, Ramzi Jabbour. They had been up all night observing the interrogation. In its submission to Clarke, Queensland police make it clear they still didn't think Haneef had a case to answer. Detective Superintendent Gayle Hogan, the most senior Queensland officer attached to Operation Rain, told Jabbour that, based on what was known at that time, "there was insufficient evidence to support a charge against Dr Haneef".

The submission continues: "Detective Superintendent Hogan was present when Senior Investigating Officer Jabbour had a telephone conversation with his senior AFP management and heard Senior Investigating Officer Jabbour articulate during that conversation that the [Queensland police] view was that there was insufficient evidence to charge Dr Haneef. Detective Superintendent Hogan was then advised by Senior Investigating Officer Jabbour that he was going to charge Dr Haneef." A fortnight later, Haneef flew home to India a free man. Australia couldn't keep him. Britain didn't want him. The AFP's plans had gone terribly wrong from the moment of his charging. First, the magistrate Jacquie Payne, unimpressed by the case against him, granted him bail. That spurred an immediate review of the case by the DPP himself, Damien Bugg. He opted not to appeal the magistrate's decision.

Haneef remained for the moment in detention. Plan B had been activated and his visa cancelled. That caused public uproar. Embarrassment for the AFP and the Government deepened on July 20 when the ABC's London correspondent, Rafael Epstein, broke the story that the SIM card - despite all public impressions to the contrary - was not connected to the London and Glasgow bombing attempts. That was no news to the police. As the DPP pressed them for more evidence, they fought back, insisting Haneef was only charged because of Porritt's advice. Keelty would even claim later that he was "surprised" by the charging. The AFP has told the Clarke inquiry: "If the AFP had ignored the CDPP advice this would have been without precedent. The AFP would have been severely criticised for refusing to accept the advice, which it understood to be the settled corporate advice of the CDPP." Budd gave the AFP a deadline of midday July 26 to advise if there was any material forthcoming "to address the concerns about the sufficiency of the likely evidence". There wasn't. Next day, Budd pulled the plug. Haneef left the country. The AFP continued to investigate Haneef for a year without result. In April this year, the Clarke inquiry was set up with high expectations and essentially no powers to investigate the fiasco. It is due to report on November 14.

"This has impacted so much of my life - my family, my career, my reputation," Mohammed Haneef told the Herald this week. "I hope that this inquiry gives a comprehensive account of what happened and address all the wrongs that have been done to me. My family needs to be assured that all wrongs are corrected and redress is given."