A simple question: Was the nine hour detention of David Miranda, the partner of Guardian journalist Glenn Greenwald, illegal? The Brazilian was held at Heathrow on his way from Berlin to Rio de Janeiro - where he lives with his partner, Guardian journalist Glenn Greenwald, who has published information from US whistleblower Edward Snowden.

A simple question: Was the nine hour detention of the partner of Guardian journalist Glenn Greenwald David Miranda lawful? The Brazilian was held at Heathrow on his way from Berlin to Rio de Janeiro - where he lives with his partner, Guardian journalist Glenn Greenwald, who has published information from US whistle-blower Edward Snowden.Let’s start with what we do know. A press release from Scotland Yard made the following announcement: “At 08:05 on Sunday, 18 August a 28-year-old man was detained at Heathrow airport under schedule 7 of the Terrorism Act 2000. He was not arrested. He was subsequently released at 17:00.”Before tackling the issue of whether or not the detention was legal, I suggest all readers turn their eyes to David Anderson QC, the independent reviewer of terrorism legislation, who released these figures about the application of Section 7 of the Terrorism Act last week: “Around 245 million passengers used UK ports, according to 2010/11 figures. In the year 2012/13, 61,145 people were stopped and examined under Schedule 7, down by 30% on three years earlier. Of those who were stopped last year, only 2,277 were held for more than one hour. For the period April 2009 to March 2012, only 1.2% of those stopped were held for more than three hours.” As @jackofkent points out in his blog, “according to the official report on use of terrorism powers, only 0.06% of detainees are held for more than six hours. This is not surprising given the limited scope of the question to be determined. It seems 97.2% of those detained are freed in less than one hour.”The fundamental question raised by Schedule 7 is whether or not it should be possible for a police officer, immigration officer or customs officer to question and detain a traveller for any period at all "whether or not [the officer] has grounds for suspecting that [the traveller] … is or has been concerned in the commission, preparation or instigation of acts of terrorism".To me there are actually 4 legal questions to ask in order to determine whether or not a person can be detained under the Terrorism Act: 1. Are the security services empowered by the legislation to question a suspect? 2. Does Schedule 7 empower the security services to detain a suspect? 3. Does a person whom security services determine need to be questioned and detained under the Act need to hand over items in their possession? 4. Are the security services using the detention to determine whether or not the detained is a terrorist?If the answer to any of these questions is no, then the detention must be unlawful. 1. Does Schedule 7 empower to question a suspect? Yes, at Paragraph 2(1) it says that an examining officer may question a person to whom this paragraph applies for the purpose of determining whether he appears to be a person falling within section 40(1)(b).2. Does Schedule 7 empower the security services to detain a suspect? Yes. See Paragraph 6(1)(b) which provides a power to detain a person for the purpose of questioning.3. Does a person whom security services determine need to be questioned and detained under the Act need to hand over items in their possession? Yes. Under paragraph 5(a), the detained person “must give the examining officer any information in his possession which the officer requests”. Under paragraph 18, it is an offence for that person not to comply with any duty (including the duty to provide information).4. Are the security services using the detention to determine whether or not the detained is a terrorist?This is where it gets complicated. Prima facie, so far it appears that the legislation is lawful; however, if we break the legislation down further what Schedule 7 of the Terrorism Act allows for is specifically passengers to be detained in order to determine out whether or not they appear to be terrorists. As I mentioned earlier, the schedule provides at paragraph 2(1):“An examining officer may question a person to whom this paragraph applies for the purpose of determining whether he appears to be a person falling within section 40(1) (b).”‘Determining’ in this context is a kind of legal qualifier. One cannot detain someone under the Terrorism Act in order to determine what songs they downloaded from iTunes last month. Nor can they be detained under Schedule 7 of the Terrorism Act in order to determine whether they are in possession of stolen goods. That would be an egregious abuse of state power. The legislation gives effect to a determining factor in whether or not a person appears to be a person falling within Section 40.Section 40(1) (b) reads: “terrorist” means a person who— is or has been concerned in the commission, preparation or instigation of acts of terrorism. Therefore, the Act only empowers security services to detain and question people in order to determine whether or not they are going to commit an act of terrorism. Paragraph 2(4) provides for an examining officer to exercise this power whether or not he or she has grounds. This means that there does not need to be a reasonable suspicion. But what paragraph 2(4) does not do is specifically negate the requirement that the power be exercised for the purpose specified.If the purpose of the detention was not for the purpose of determination under Schedule 7, then it has to be unlawful. There has been nothing to suggest that the authorities thought that David Miranda was a terrorist, nor was there any suggestion that the authorities thought he was one. Schedule 7 of the Terrorism Act is qualified in part by Section 40 (1)(b). What David Miranda was being investigated for did not fall within the definition of terrorism. The definition of terrorism, in this sense, makes no mention about being a journalistic mule, or carrying documents between two journalists. Schedule 7 gives the authority to detain suspects and it gives authority to question suspects. But this right is restricted by the act of “determining”. If a suspected member of Al-Qaeda was travelling through Glasgow Airport, it makes sense that any detention of the suspect would be on the basis that the security services sought to determine whether or not he was going to commit an act of terrorism within the legal meaning given effect by Section 1 of the Terrorism Act. It seems clear to me, based on the facts known at the time, that David Miranda was not detained for the purposes of determining whether he was going to be committing terrorism, but rather for some other nefarious purposes – such as what was on the other 49 unpublished slides, intimidation, or to send a message to other journalists. Even if it was to seize the material Miranda was carrying, the legal grounds of doing so seem shaky at best.