David Miranda, the partner of journalist Glenn Greenwald, has lost his High Court claim that he was detained unlawfully at Heathrow under anti-terror laws last year.
Brazilian Miranda lives with Greenwald, who exposed secret information on US surveillance leaked by whistle-blower Edward Snowden.
Articles based on some of the Snowden material were published by The Guardian and other news publications, and one of the leading figures in writing those articles was Mr Greenwald.
Lord Justice Laws, sitting with Mr Justice Ouseley and Mr Justice Openshaw, rejected Mr Miranda's claim that his detention by police at the airport last August under Schedule 7 of the Terrorism Act 2000 was both unlawful and a breach of his human rights.
Rights group Liberty has called for an overhaul to Schedule 7, which it describes as "ripe for misuse and discrimination".
“If such a barefaced abuse of power is lawful then the law must change. Miranda’s treatment showed Schedule 7 for what it is: a chillingly over-broad power, routinely misused," Rosie Brighouse, legal officer for Liberty said.
"People are held and interrogated for hours, their property confiscated while they’re swabbed for saliva – all without any suspicion that they’ve done anything wrong.”