Two unborn babies have had their spines repaired by surgeons - weeks before they were born.

The operations - which are the first ever of their kind in the UK - were carried out by a team of 30 doctors at University College Hospital in London.

The babies had spina bifida, a condition when the spinal cord fails to develop properly and has a gap in it.

It is usually treated after birth, but the earlier it is repaired the better for long-term health and mobility.

During the 90-minute surgery carried out this summer, doctors cut an opening in the womb and then stitched together the baby's gap in the spine.

The procedure is risky and can cause premature labour, but researchers are exploring less invasive keyhole methods.

"We put the mum on some drugs that help relax them, but there is still a risk," said UCL Professor Anne David, who has worked on bringing the surgery to the UK for three years.

Mums and babies are recovering well, the hospital said.

Mothers previously had to go abroad to the US, Belgium or Switzerland for the operation.

"It's fantastic," said Prof David. "Women now don't have to travel out of the UK. They can have their family with them. There are less expenses. So all good things."

What is spina bifida?

According to the charity Shine, more than 200 children are born with spina bifida every year.

The NHS says the condition happens when the baby's neural tube - an early form of the baby's brain and spinal cord - does not form properly and leads to gaps or defects in the spinal cord and bones of the spine.

Surgery can be used to close the gap in the spine in most cases, but often the nervous system will already have been damaged leading to problems including paralysis of the legs and incontinence. Some people with the condition have learning difficulties.

It is not known what causes the condition, which develops during pregnancy, but a lack of folic acid can increase the risk.

The surgery, which follows a trial in the US, will be available for patients through the new Centre for Prenatal Therapy at Great Ormond Street Hospital and UCL hospital.

"There were some children who had grown up following foetal surgery who were walking and you wouldn't expect them to be walking if they hadn't had it," said Prof David, of the recent US study.