A Frenchwoman whose symptoms started out as “electric shocks” in her legs got an even bigger shock when she found out that she had a tapeworm in her spine.

A 35-year-old Frenchwoman reported tingling in her legs. It turns out she had a parasite called Echinococcus granulosus, or dog tapeworm, in her spine, as this X-ray shows. New England Journal of Medicine

The parasite caused enough swelling in the woman’s spine to affect her ability to walk and ride a horse, French doctors reported in Thursday’s issue of the New England Journal of Medicine.

“A 35-year-old woman presented to the emergency department with weakness, a feeling of electric shocks in both legs, and repeated falls,” Dr. Marine Jacquier and Dr. Lionel Piroth of the Centre Hospitalier Universitaire in Dijon wrote.

"She reported that the symptoms had been progressing, and she noted that she had had difficulty riding her horse for the preceding three months.”

An X-ray showed something in her spine. It turned out to be a tapeworm known as Echinococcus granulosus, the hydatid worm, or dog tapeworm.

It took some careful surgery to get the parasite out, and the woman was also treated with anti-parasitic drugs. She fully recovered.

The cycle of a parasite. Centers for Disease Control

"We cannot be sure about how our patient was infected. This disease is very rare in France," Piroth told NBC News.

The worm is found most commonly in sheep and can be passed along through dog droppings, but cattle and cats also can carry and spread it. The woman had a pet cat and had contact with cattle.

Contaminated raw vegetables could, in theory, transmit the worm, Piroth said. Usually people get infected by eating or slaughtering animals, but it's possible that horses or the cat carried the parasite, he said.

As with many worms, the hydatid worm can take up residence in various organs of the body, including the brain. They cause a cyst to form and that can become inflamed. In the case of the Frenchwoman, that inflammation squeezed the nerves in the spinal cord, affecting her legs.