Four teenage girls have received vaginas grown from their own cells in a lab. And they work.

These girls were born with underdeveloped or missing vaginas because of a rare condition called Mayer-Rokitansky-Küster-Hauser Syndrome that affects about 1 in 5,000 women. While their labia looked like those of other girls, their vaginas, cervixes and wombs, which are necessary for menstruation and childbirth, never fully formed.

Medical researchers took a vaginal tissue sample from each patient, who were between 13 and 18 at the time, and used them to grow cells in the lab. After four weeks, the researchers had enough cells to layer them on to degradable scaffolding — “like the layers of a cake,” lead researcher Anthony Atala of the Wake Forest School of Medicine explained.

Then they were implanted.

The surgeries were done between 2005 and 2008. Atala and the team monitored the women for long-term complications before publishing the results in the medical journal The Lancet this week. The achievement was the work of a large team listed here.

The technique is a potentially important alternative to reconstructing tissue using grafts from other parts of the body, which medical researchers say produces too many complications. The trick was growing cells until they were mature enough to “recruit” other cells once implanted in the body and form tissue that includes blood vessels and nerves.

The researchers worked with a team of surgeons at the Federico Gomez Children’s Hospital of Mexico in Mexico City to figure out the right shape and size of the scaffolding for each patient. Surgeons then inserted the engineered vaginas into the patients, connecting them to the uterus and stitching them into place.

The scaffolding degraded in the months after surgery, leaving just the tissue. The tissue grew, forming the muscle and epithelial cells that make up the vaginal wall. Six months later, the patients were able to menstruate and have sexual intercourse for the first time. “After the operation they were able to function normally,” Atala told reporters.

“They had normal levels of desire, arousal, satisfaction and orgasm.” Some may also be able to have children. “I truly feel fortunate, because I’ll have a normal life – completely normal,”  a patient who wished to remain anonymous said in a video provided by the hospital in Mexico. “It’s important to let other girls that have the same problem know that it does not end knowing that you have the disease, because there is a treatment.”

This is also a big deal for science. The sex organ is the first normally functioning vagina ever created in a lab. Atala’s work also shows lab-engineered organs can grow to maturity inside the human body, which opens the door to other potential advances in medicine. Atala said he hopes the technique can be used to treat women who suffer damage through trauma, such as car accidents or cancer, as well. The breakthrough could also be meaningful to transgender people seeking sex-reassignment surgery, though the researchers did not comment on that possibility.