The past few years have been marked by the proliferation of lab-grown organs, including limbs, livers, skin, heart tissue, and yep, even penises. But piecing together an organ, cell-by-cell, in a way that resembles the real thing is only half the challenge - you’ve actually got to make it work as part of several incredibly complex systems in a living, breathing organism. And that’s where most attempts fall flat.

But researchers in Japan have managed to grow fully functioning kidneys in the lab, and when transplanted into pigs and rats, they filtered out urine just like a natural kidney. Built using stem cells that had been extracted and then incubated in the animal recipients, the kidneys point to the possibility of lab-grown kidneys for humans in the future.

Led by Takashi Yokoo from the Jikei University School of Medicine in Tokyo, the team figured out how to overcome a challenge they’d faced previously with these lab-grown kidneys: they were good at processing urine, but instead of passing it into the natural ureter, they ballooned dangerously under the pressure.

So Yokoo and his colleagues constructed new kidneys with a special drainage tube and a bladder to store the urine until it was ready to be fed into the actual bladder. Known technically as a stepwise peristaltic ureter (SWPU), this 'lab-grown kidney with extras' was connected successfully to the transplant recipient’s ureter.

"To our knowledge, this is the first report showing that the SWPU system may resolve two important problems in the generation of kidneys from stem cells: construction of a urine excretion pathway and continued growth of the newly generated kidney," the researchers report.

According to Michelle Roberts at BBC News, the transplants were first tested in rats, and were still working fine when the researchers checked up on them eight weeks later. "They then repeated the procedure on a much larger mammal - a pig - and achieved the same results," Roberts reports.

While human trials are still a long way off, the results are promising, Chris Mason, an expert in stem cells and regenerative medicine at University College London in the UK, told the BBC:

"This is an interesting step forward. The science looks strong and they have good data in animals. But that's not to say this will work in humans. We are still years off that. It's very much mechanistic. It moves us closer to understanding how the plumbing might work. At least with kidneys, we can dialyse patients for a while so there would be time to grow kidneys if that becomes possible."

The results have been published in PNAS. Watch the video below to see what they look like: