A 13-year-old girl in California continues to be on a ventilator after being declared brain-dead by doctors. Although a brain-dead person is not legally alive, how much of the body will keep on working with the help of technology, and for how long?

Jahi McMath of Oakland, Calif., was declared brain-dead last month after experiencing an extremely rare complication from tonsil surgery. Jahi's family members have fought to keep their daughter on a ventilator, but a judge has ordered that the machine be turned off next week.

A person is considered brain-dead when he or she no longer has any neurological activity in the brain or brain stem — meaning no electrical impulses are being sent between brain cells. Doctors perform a number of tests to determine whether someone is brain-dead, one of which checks whether the individual can initiate his or her own breath, a very primitive reflex carried out by the brain stem, said Dr. Diana Greene-Chandos, an assistant professor of neurological surgery and neurology at Ohio State University Wexner Medical Center. "It's the last thing to go," Greene-Chandos said. [10 Surprising Facts About the Brain]

In the United States and many other countries, a person is legally dead if he or she permanently loses all brain activity (brain death) or all breathing and circulatory functions. In Jahi's case, three doctors have concluded that she is brain-dead.

However, the heart's intrinsic electrical system can keep the organ beating for a short time after a person becomes brain-dead — in fact, the heart can even beat outside the body, Greene-Chandos said. But without a ventilator to keep blood and oxygen moving, this beating would stop very quickly, usually in less than an hour, Greene-Chandos said.

With just a ventilator, some biological processes — including kidney and gastric functions — can continue for about a week, Greene-Chandos said.

Kenneth Goodman, director of the Bioethics Program at the University of Miami, stressed that such functions do not mean the person is alive. "If you're brain-dead, you're dead, but [with technology], we can make the body do some of the things it used to do when you were alive," Goodman said.

Without the brain, the body does not secrete important hormones needed to keep biological processes — including gastric, kidney and immune functions — running for periods longer than about a week. For example, thyroid hormone is important for regulating body metabolism, and vasopressin is needed for the kidneys to retain water.

Normal blood pressure, which is also critical for bodily functions, often cannot be maintained without blood-pressure medications in a brain-dead person, Greene-Chandos said.

A brain-dead person also cannot maintain his or her own body temperature, so the body is kept warm with blankets, a high room temperature and, sometimes, warm IV fluids, Greene-Chandos said.

The body of a brain-dead person is usually not supported for very long, Greene-Chandos said. Doctors sometimes provide support (in the form of a ventilator, hormones, fluids, etc.) for several days if the organs will be used for donation, or if the family needs more time to say good-bye, Greene-Chandos said.

If all of the criteria for brain death are met, "then it's pretty clear that there's nothing left, and we're supporting the body," Greene-Chandos said.

Greene-Chandos said Jahi's case is tragic, and as a mother, she is heartbroken for the family.

There is very little research on just how long the body of a brain-dead person can be maintained. The discussion of brain death dates back to the 1950s in France with six patients who were kept "alive" for between two and 26 days without blood flow to the brain. This generated the idea that "perhaps there's a second way to die, because these patients will eventually die," Greene-Chandos said. (Previously, a person was considered dead only when their heartbeat and breathing stopped.)

Today, with ventilators, blood-pressure augmentation and hormones, the body of a brain-dead person could, in theory, be kept functioning for a long time, perhaps indefinitely, Greene-Chandos said. But with time, Greene-Chandos added, the body of a brain-dead person becomes increasingly difficult to maintain, and the tissue is at high risk for infection.

Terri Schiavo's family, who fought to keep their brain-damaged daughter on life support for 15 years, has said they are trying to help move Jahi to another facility for long-term support. Unlike Jahi, Terri Schiavo was not brain dead, but in a vegetative state in which she had some brain activity.

Editor's note: The article has been updated to remove the incorrect statement that hair and nails grow after death.

Rachael has been with Live Science since 2010. She has a masters degree in journalism from New York University's Science, Health and Environmental Reporting Program. She also holds a Bachelor of Science in molecular biology and a Master of Science in biology from the University of California, San Diego.