A 7-year-old Long Island, N.Y. girl headed home Tuesday after spending more than a month in the hospital recovering from a high-risk surgery that allowed doctors to remove a baseball-sized tumor wrapped around her stomach and other organs.

Surgeons at New York-Presbyterian Morgan Stanley Children's Hospital in New York City removed six of Heather McNamara’s vital organs during a 23-hour surgery on Feb. 6.

The surgery, though extremely risky, was necessary if doctors wanted to save Heather’s life, Dr. Steven Lobritto, an internist, pediatrician and gastroenterologist with Morgan Stanley Children's Hospital, told FOXNews.com.

“The child had an inoperable tumor that was unresponsive to chemo,” said Lobritto, who worked with lead surgeon Dr. Tomoaki Kato and others from New York-Presbyterian on Heather’s case. “The operation gave us a chance to cure her, but it was difficult to achieve, and it could have killed her.”

Previous attempts to remove the tumor, which was wrapped around Heather’s stomach, spleen, pancreas and essential blood vessels, had failed, Lobritto explained.

“She’s left with a number of deficiencies (from the operation),” he said. “But all-in-all, we gave her a pretty normal life.”

During the surgery, doctors removed Heather’s stomach, pancreas, spleen, liver and small and large intestines, and placed them on ice so that they could be re-implanted after the tumor was extracted. Many of her blood vessels also had to be removed and reconstructed from other vessels in the body or artificially.

It's the first time an operation such as this has been performed on a child, and only the second time ever it's been performed in the U.S., Lobritto said.

“Other cancer hospitals had tried to remove the tumor, but couldn’t do it,” Lobritto explained. “In order to successfully remove a tumor, you have remove, not only the tumor, but also a marginal amount of the normal tissue around it. In this case, you couldn’t do that without removing and re-transplanting the organs. Our surgeons are transplant experts, which is why we did it here.”

The tumor had become so invasive that doctors were unable to save her pancreas, spleen and stomach. The lack of stomach means that Heather will have to eat small meals, much like someone who has had gastric bypass surgery for weight loss, as well as take nutritional supplements such as B12 and calcium, Lobritto said.

The loss of her spleen leaves Heather open to several types of infections, which doctors have taken measures to protect her against. The pancreas is responsible for keeping sugars stable in the body and produces natural enzymes that aid in digestion. Without one, Heather is essentially type 1 diabetic and will have to take medicine to regulate her sugar and insulin levels, as well as take supplemental enzymes to help with food digestion.

Heather will be tube fed while doctors monitor her and make sure her bowel is working properly, and she won’t be able to do any heavy lifting in the immediate future. She and her family are also being trained to manage her diabetes.

“We’ll follow her frequently in the beginning … and our team will monitor her for a reoccurrence of the tumor,” Lobritto added. “And her family is being trained to be autonomous. But she’ll be able to interact with people and … live a completely normal life.”