Mr Justice Treacy also held that health minister Edwin Poots breached the ministerial code by failing to take the issue before the Stormont Executive. His verdict in a challenge brought by an unidentified homosexual man represents a major victory for campaigners seeking equal status with the rest of the UK.

The complete prohibition, put in place during the 1980s Aids threat, was lifted in England, Scotland and Wales in November 2011.

It was replaced by new rules which allow blood from men whose last sexual contact with another man was more than a year ago. The 12-month deferral was left in place following a government advisory committee report.

It identified a much shorter a window period during which infection with blood-borne viruses could not be detected. Mr Poots maintained the ban in Northern Ireland on the basis of ensuring public safety. But a gay man granted anonymity due to his perceived vulnerability launched a judicial review challenge to Mr Poots’s position.

Mr Justice Treacy heard claims that the minister has displayed apparent bias which went beyond religious beliefs and into the realms of prejudice. It was revealed in court that despite the unidentified applicant’s sexual orientation, he has become a born-again Christian who now disapproves of homosexual practices. Attorney General John Larkin QC, the chief legal adviser to the Stormont Executive, questioned the legitimacy of the challenge.

He claimed the challenge was a waste of time because the applicant had previous had sex for money. Mr Larkin rejected arguments that the issue required full Executive approval and questioned whether the Minister had made a decision to maintain the current ban.

However, Mr Justice Treacy pointed out that in continuing the lifetime deferral policy the minister had deviated from the position taken in England, Scotland and Wales. He said the decision was made against the Secretary of State’s recommendation that the report from the advisory committee on the Safety of Blood, Tissues and Organs (SaBTO) should be followed.

The judge held that the additional risk from deferring donation for 12 months instead of permanently was very minimal. He said: “The minister has decided that MSM (males who have sex with other males) behaviour creates such a high risk of infection to the donor that such donors must be permanently deferred with the result that such blood cannot enter the Northern Ireland blood stock.

“Importing blood from other places which do accept MSM donors, even in limited quantities, leaves the door open for MSM blood to do just that. “There is clearly a defect in reason here.” Applying different standards to imported blood defeats the whole purpose of a permanent deferral, he added. Declaring the decision irrational, he said: “If there is a genuine concern about the safety of MSM donated blood such that the blood stock must be protected absolutely from such blood then the security of that blood must actually be maintained absolutely.”

Dealing with the alleged breach of the ministerial code, Mr Justice Treacy said the lifetime ban was both controversial and cross-cutting, taking in equality issues. “As such the minister the minister had no authority to act without bringing them to the attention of the Executive Committee which he failed to do. “In doing so the minister breached the ministerial Code and... had no legal authority to take a decision in breach of the ministerial Code.”