LONDON — A team of surgeons has repaired the spinal cords of two babies while they were still in their mothers’ wombs, the first surgery of its kind in Britain.

The operations were carried out over the summer at University College Hospital in London by 30 surgeons to treat spina bifida, a condition in which the spinal column and spinal cord do not develop properly in the womb, causing a gap in the spine.

“This results in changes to the brain, as well as severe permanent damage to the nerves on the lower half of the body,” Dominic Thompson, a neurosurgeon at the Great Ormond Street Hospital in London who was involved in the surgery, said Thursday in a statement.

The surgery is usually performed after birth, but research has shown that the earlier the condition is treated, the greater the chances of healthy mobility. Those born with spina bifida are often unable to walk and have to undergo a series of operations to drain fluid from their brain.