A major clause in the UK’s Terrorism Act 2000 that allows border guards to question suspects when they arrive in the country is incompatible with European human rights laws, a senior judge has ruled.

Ruling in the case of David Miranda — the partner of Glenn Greenwald, who was detained at Heathrow Airport in 2013 while carrying intelligence files leaked by Edward Snowden — John Dyson said powers contained in schedule 7 of the Act were flawed.

The section allows border guards to spend up to six hours questioning passengers they believe to be terrorists. Those who are questioned under the clause have no right to remain silent or receive legal advice.

Lord Dyson ruled, however: “The stop power, if used in respect of journalistic information or material, is incompatible with article 10 [freedom of expression] of the [European convention on human rights] because it is not ‘prescribed by law’.”

He continued: “If journalists and their sources can have no expectation of confidentiality, they may decide against providing information on sensitive matters of public interest.”

The Guardian reports that the judge issued a “certificate of incompatibility” which, while not striking down the law, will force ministers to re-examine it.

Despite this, the court still ruled that Mr Miranda’s detention was lawful under the terms of the Act, upholding a decision by the High Court in 2014. The court agreed police exercised their powers “for a permitted purpose,” and rejected Mr Miranda’s argument that his detention was “an unjustified and disproportionate interference with his right to freedom of expression.”

This is latest in a series of court decisions where British government policy has been ruled incompatible with European law.

In November, the Supreme Court ruled that a requirement for migrants to pass an English language test before settling in the UK breached the European Convention on Human Rights.

Government policy said that spouses of migrants already in the UK must pass an English language test in their home country before being allowed to join them. However, five judges warned the rules may contravene section 8 of the Convention, which deals with the right to a family life.

“It does appear virtually certain that there will be a significant number of cases where application of the guidance will lead to infringement of Article 8 rights,” Lord Neuberger, the court’s president said.