A Dallas pastor was sentenced to 99 years in prison on Friday for starving a child to death after she believed it was the only way to exorcise a “demon” from the boy’s body.

The pastor, Aracely Meza, 52, was convicted of felony injury to a child causing serious bodily injury; investigators say both she and the parents of the toddler, Benjamin Aparicio, believed he was possessed by a demon and could only get rid of it by fasting.

Prosecutors say the boy was denied food for three weeks.

Videos were shown in court, depicting a resurrection ceremony led by Meza where she is seen holding the frail, lifeless body of Aparicio, The Dallas Morning News reported.

Jurors were shown one video of Meza spanking the toddler, who appeared unable to support his own head, after he fell on the kitchen floor.

Aparicio died on March 22, 2015.

Meza testified that she'd been acting on God’s orders.

She was sentenced to 99 years in prison and was also ordered to pay a $10,000 fine. The boy’s parents, who are also facing charges, are believed to be in Mexico, the newspaper reported.

The Associated Press contributed to this report.