Every year, thousands of people suffering from organ failure die while waiting for a new kidney, heart or lung. We’re still a long way from ending the shortage of donor organs — and some say self-driving cars could compound the problem by curbing the number of fatal car accidents — but new research adds to the hope that doctors might someday be able to replace failing organs with organs grown in the lab.

A team of researchers in Texas showed that bioengineered lungs could be implanted into pigs without triggering an immune reaction or causing other medical problems. Four pigs survived for as long as two months with the lab-made lungs — a result that buoyed the researchers.

“Whole organ transplants such as this had never been done before with a positive result,” said Joan Nichols, a professor of internal medicine at the University of Texas Medical Branch (UTMB) in Galveston and one of the researchers. “That was a very good first try.”

Could we breathe with lab-grown lungs? Scientists might be getting closer. Joan Nichols

But the lungs weren’t capable of respiration. As explained in a paper published Aug. 1 in the journal Science Translational Medicine, each pig continued to breathe using its own right lung, its left lung having been replaced by a lab-grown one.

Creating functional lungs is one of many challenges facing scientists working to make bioengineered lungs an option for humans. The next major hurdle — and it’s a big one — will be getting the artificial lungs to actually work to oxygenate the blood.

“Once we’ve done that, there’s no reason why we couldn’t be able to produce two lungs that are capable for the animal to breathe,” said Joaquin Cortiella, director of the UTMB Lab of Tissue Engineering and Organ Regeneration and the paper’s senior author. Cortiella takes a special interest in the work because he suffers from the lung condition pulmonary fibrosis.

That feat could take some time.

“In my mind, we’re still probably 20 years away from a first in-man human-engineered lung,” said Laura Niklason, a professor of anesthesiology and biomedical engineering at Yale University who is working on bioengineered lungs as part of another team of researchers.

The Galveston team has been working on building bioengineered lungs for more than 15 years. Their process starts about a month before the transplant, when a lung taken from another animal is chemically stripped of its cells. The resulting lung “scaffold” is then seeded with cells taken from the recipient animal and treated with chemicals that cause these cells to proliferate.

The idea is that since the cells that make up the resulting lung come from the recipient animal’s own body, the animal’s immune system doesn’t reject the lung — a hypothesis borne out by the new research.

“Nobody knew that if we grew cells outside your body for 30 days in a bioreactor tank whether your body would welcome them back,” Nichols said, adding that when the pigs’ bodies did accept the cells, “that was amazing.”

Nichols said that, theoretically at least, human donor lungs could be used as scaffolds even if they weren’t healthy enough to be transplanted. That could mean that many more people could get the lungs they need. Eventually, she added, it might be possible to create scaffold lungs using a 3D printer — eliminating the need for donor lungs at all.

More than 100,000 Americans are on the waiting list for a new organ, including 1,500 who are hoping for new lungs, according to the United Network for Organ Sharing, the Virginia-based nonprofit that manages the country’s organ transplant system.

WANT MORE STORIES ABOUT SCIENTISTS GROWING THINGS IN LABS?

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.