The European Court of Justice has ruled that EU governments may ban gay men from ever donating blood, but only under strict conditions.

Wednesday's ruling was closely watched by activists and by governments that have lifetime bans on homosexual male blood donors because they are more likely than other groups to have HIV, the virus that causes AIDS.

Frenchman Geoffrey Leger had protested France's ban. The court found that France's law is "liable to discriminate against male homosexuals on the basis of sexual orientation," which is against EU policy.

But it said lifetime bans may be justified if a donor presents a high risk of acquiring severe infectious diseases and there is no other method to protect blood recipients. It returned the case to the French court for further study.