By Dr. Max Gomez

NEW YORK (CBSNewYork) — Try to imagine being a healthy high school student, and out of the blue one day you’re in liver failure so bad you may only have days to live without a transplant.

That happened to one teenager, but as CBS2’s Dr. Max Gomez reported Thursday, the boy had a miraculous recovery, thanks to what’s been called a dialysis machine for the liver.

Diego Catalan was 17 years old, a junior in high school, learning plant science, playing saxophone in the marching band, and clowning around with his twin sister. Then, after a routine day at school, he spent the next day vomiting and then slept for 36 hours.

“He just wanted to keep laying back down and going to sleep, so it was kind of scary. And he was already not behaving like himself. He was like acting like weird,” said Alice Catalan, Diego’s mother. “He was kind of out zombie, and then the doctors started telling me that he’s in acute liver failure and he needs a liver transplant right away.”

READ MORE14-Year-Old California Boy On The Mend After Having Extremely Rare Heart And Liver Transplant

It had only been a little more than two days since Diego was completely normal. Suddenly, there was the urgency for a transplant was because, “His brain has already started to demonstrate some signs of swelling, and that’s an extremely dangerous condition because the river detoxifies all the toxins in the body that eventually end up in the brain in a child,’ said Dr. Nadia Ovchinsky of Children’s Hospital at Montefiore.

With no donor liver on the near horizon, doctors asked Diego’s parents for permission to try something that’s only been done at four children’s hospitals in the U.S., a machine called MARS, short for a very long medical name, that’s kind of like dialysis for the liver.

READ MOREQueens Woman Undergoes Liver Transplant After Doctors Link Mystery Infection To Nose Piercing

Within 24 hours, “Diego’s case was really quite impressive. Every time he walked into his room, he was getting better and better and he was more awake and more alert and answering more quickly,” Dr. Mark Shlomovich said.

It’s still hard for Diego to process because he was pretty much out of it for most of the real drama.

“I asked my mom, ‘Like, so what actually happened?’ And she told me everything that happened and I was like, ‘Rally? That actually happened? Like, I feel perfectly fine,'” Diego said.

Removing toxins is only half the liver’s job. It also manufactures many critical blood components that are needed for life. That’s why the MARS machine is normally a bridge to transplant, keeping a patient alive long enough to find a donor liver.

While Diego will have to be monitored closely, he should do fine, partly because the liver is the only organ in the body that can regenerate.

Dr. Max Gomez