A Texas judge has temporarily blocked a children's hospital from taking a 9-month-old off life support in a court battle that has drawn in the state's attorney general and Texas Right to Life.

Tinslee Lewis has been critically ill her entire life and has spent every day at Cook Children's Medical Center in Fort Worth, the hospital said in a Nov. 15 press release. Born prematurely in February with a rare heart defect, she underwent her first surgery that same month.

In July she suffered further deterioration due to severe chronic lung disease, resulting in respiratory arrest, the hospital release said. She has since been on a machine that replaces the function of her heart and lungs in addition to being on a ventilator. Doctors also believe she is in pain, and she "requires significant sedation."

"In Tinslee’s time at Cook Children’s, our care team has done everything they can to keep her alive. She’s undergone multiple complex surgeries and despite our best efforts, shows no signs of improvement," the release said.

The hospital said that last month it began reaching out to more than 20 other medical facilities across the country to see if they would take Tinslee as a patient, but they "all agreed further care was futile," the release said.

Under Texas law, doctors, with the approval of an ethics committee, can end a patient's life-saving treatment even if the patient or the family member responsible for making decisions on behalf of the patient objects.

Tinslee Lewis. Courtesy of Texas Right to Life via AP

The patient's family must be given at least 10 days to try to find another hospital to transfer the person to before care is suspended, the Texas Tribune reports.

Tinslee's family wants her medical care to continue and is represented by the Texas Right to Life organization, The Associated Press reported. A district judge agreed and has issued orders that require the hospital to continue treatment until at least Dec. 10.

The child's mother, Trinity Lewis, said at a Nov. 9 press conference that she had thought they were “going to pull the plug on my baby. I didn’t think that she was going to still be here today. And that’s what I’m grateful for.”

The battle has caught the attention of Texas Attorney General Ken Paxton, who filed a brief with the District Court of Tarrant County. In a statement Friday, he said the hospital's decision to remove Tinslee from life support "directly violates the mother's request and her daughter's right to life." He slammed the state law as "unconstitutional."

"Patients must be heard and justly represented when determining their own medical treatment, especially when the decision to end treatment could end their life," he said.

Cook Children's said it has been in contact with Lewis and other family members over the past several months about the best course of action for Tinslee. In September, they began talking to the family about instituting a do not resuscitate order and withdrawing lifesaving treatment.

"As medical professionals, our responsibility – our highest duty – is to save lives. We are still working with Ms. Lewis and Texas Right to Life to find alternative care, however, it is our sincere belief that further medical intervention is not in Tinslee’s best interest."