LONDON  Ireland, where it is virtually impossible to obtain a legal abortion, will most likely have to rewrite its laws after a European court ruled Thursday that it had violated its own Constitution by failing to provide abortion services to a pregnant woman who had cancer.

Ireland has one of Europe’s most stringent anti-abortion laws, holding that abortion is illegal in every circumstance except where there is a “real and substantial risk” to the mother’s life. But the court, the European Court of Human Rights in Strasbourg, France, said that in practice the Irish government made it impossible for women to get medical advice or abortions in such cases.

The ruling came in the case of a Lithuanian woman who had a rare form of cancer and was living in Ireland. She went to Britain to have an abortion when she found doctors in Ireland unwilling even to tell her if her health was being jeopardized by her pregnancy. After finding Ireland at fault for denying the woman an “effective or accessible procedure” to establish her right to a lawful abortion and thus violating her constitutional rights, the court ordered the Irish government to pay her 15,000 euros, about $20,000.

The ruling will probably force the Irish government, for the first time, to enact legislation setting out how and in what circumstances women with life-threatening conditions can get abortions.