Alberta’s top court has upheld a ruling that a two-year-old girl who was allegedly abused by her parents should be taken off life support and put into palliative care.

The Alberta Court of Appeal ruled that the girl’s mother and father will each be allowed a final 20-minute visit with the girl, who has been on life support since May after she was found in cardiac arrest.

The girl’s parents have been charged with aggravated assault, criminal negligence causing bodily harm and failing to provide the necessities of life. If the toddler dies the charged could be upgraded.

Last week an Alberta judge sided with the girl’s doctors when she ruled that it was in the best interest in the child, identified as Baby M, to be taken off the machines that were keeping her alive.

However, the decision was quickly stayed so an appeal by the girl’s parents could be heard.

The parents, originally from Algeria, asked the court to keep their daughter alive against doctors’ recommendations because of their Muslim beliefs.

Because the parents’ charges could be elevated to murder if Baby M dies, Justice June Ross found their desire to keep her alive suspicious.

"They are, inherently, in a conflict of interest," she wrote in her decision Friday. "I am left with a concern that their decision may in fact be affected by self-interest."

Doctors have testified that Baby M’s condition is believed to be permanent and she is close to brain dead.

Since being admitted to hospital her condition has remained unchanged and she has suffered three bouts of pneumonia.

Doctors said the toddler is deeply comatose and completely dependent on technology to survive.

If Baby M were to remain on the respirator she must undergo a tracheostomy, which involves making an incision in the girl’s neck to make a direct airway.

With files from The Canadian Press