A court will this week decide whether a seriously ill Muslim man should not be revived if his condition deteriorates – against the wishes of his family, who say it is God's will that doctors must do all they can to keep him alive.

The case, which will be seen in some quarters as a clash between the state and religion, is the first of its kind to deliver a judgment following a supreme court ruling last month that found doctors were right to withdraw treatment from a man in Liverpool.

The Muslim man, who has been in hospital for five-and-a-half months since suffering a heart attack, is barely conscious. The NHS trust in charge of the hospital where he is being cared for, and which cannot be named for legal reasons, argues that to revive him is not in the man's best interests if his condition worsens.

While both sides in the court of protection broadly agree that there is little chance the man's condition will improve, they are opposed over what happens if it deteriorates. The man's family, who are being represented by law firm Pannone, argue that their faith decrees they must do everything they can to keep him alive. They claim that the Qur'an insists only God can determine when someone dies and that it is up to doctors to do everything to preserve a life – even if this means it is of poor quality and painful.

The case will be studied closely by all faith groups, especially those who believe in a literal interpretation of scripture that, they claim, determines religious law must take precedence over law made by statute.

There have been legal challenges by Christian groups brought against right-to-die campaigners but this is the first challenge against a Do Not Resuscitate order following a ruling last month in the supreme court which said that appeal judges were right to allow doctors to withhold treatment from David James, a "gravely ill" man from Liverpool who died last December.

James's family had claimed that, while he would never recover his previous quality of life, he gained pleasure from his life and would wish for it to continue.

In its judgment, the court of appeal had referred to the Mental Capacity Act 2005, which states that "all reasonable steps which are in the person's best interests should be taken to prolong their life", but, crucially, notes: "There will be a limited number of cases where treatment is futile, overly burdensome to the patient or where there is no prospect of recovery."

Last month the supreme court ruled in favour of Aintree University Hospitals NHS trust.

A verdict this week against the family is likely to dismay some Muslim groups. But, equally, many doctors' groups are likely to resent any ruling that sees religious views take precedence. It is likely that either side could appeal if the ruling goes against them.