Updated

The law under which British police detained David Miranda, the partner of US journalist Glenn Greenwald, gives broad powers to officials at ports and borders to question those they suspect of terrorism.

Schedule 7 of the Terrorism Act 2000 gives British officials at ports, airports and international railway stations up to nine hours to question suspects, and allows them to search the person and their possessions.

Unlike British law in other cases, suspects held under Schedule 7 are committing an offence if they refuse to answer questions and police are also not required to have reasonable grounds to stop them.

But concerns that the law may be too harsh led Home Secretary Theresa May earlier this year to propose changes, currently before parliament, to the law reducing the questioning time to six hours.

Under Schedule 7, an "examining officer" at British ports and borders "may question a person.... for the purpose of determining whether he appears to be a person falling within section 40(1)(b)".

That section involves someone who "is or has been concerned in the commission, preparation or instigation of acts of terrorism."

The law says officers can question the person "whether or not he has grounds for suspecting that a person falls within" the section on terrorism.

Anyone held under the law "must give the examining officer any information in his possession which the officer requests" and "give the examining officer on request any document which he has with him and which is of a kind specified by the officer."

The officer can also search the person and "anything which he has with him, or which belongs to him, and which is on a ship or aircraft".

Any property held under the law must be returned to the owner within seven days from the date of detention but data can be held for longer.

If the suspect fails to comply with the officer's orders or "wilfully obstructs, or seeks to frustrate, a search or examination" they can face up to three months in jail or a fine or both.

Schedule 7 specifies that people held under Section 7 must be released "not later than the end of the period of nine hours beginning with the time when his examination begins" -- unless they are arrested under other laws.

Britain has faced criticism for using anti-terrorism laws to stop Miranda, who has been working with Greenwald on the intelligence leaks from former US National Security Agency contractor Edward Snowden, which have been published by the Guardian newspaper.

Indeed, the Home Office's own guidelines state that the Schedule 7 powers "are to be used solely for the purpose of ascertaining if the person examined is or has been concerned in the commission, preparation or instigation of acts of terrorism.

"The powers must not be used to stop and question persons for any other purpose."

Home Secretary Theresa May insisted on Tuesday that it was "right" for the police to question somebody believed to have "highly sensitive stolen information which could help terrorists, which could lead to a loss of lives."

But Schedule 7 has also come under scrutiny from Britain's anti-terrorist legislation watchdog.

David Anderson, the senior lawyer appointed as Britain's Independent Reviewer of Terrorism Legislation, told the BBC on Monday that he had asked for an official briefing on what was an "unusual case".

He pointed out that of the up to 60,000 people held under Schedule 7 every year only 40 were kept longer than six hours.

In an official report in 2012, Anderson called for a "careful review of the extent and conditions of exercise of the Schedule 7 power".

He also encouraged "those who claim to have been adversely affected by the operation of Schedule 7 powers to lodge complaints".

Miranda's lawyers said on Tuesday they had taken legal action against the British government claiming that his treatment was unlawful and demanding the return of electrical equipment taken from him.