When a young man in India started having seizures, doctors scanned his brain and found a grim image: His brain was dotted with parasitic cysts — the result of a severe and ultimately fatal tapeworm infection.

The 18-year-old man was taken to the emergency room after having so-called tonic-clonic seizures, in which a person loses consciousness and experiences violent muscle contractions, according to a new report of the case.

The man appeared confused and had swelling over his right eye. His parents told doctors that he'd also been having pain in his groin for a week. An MRI of his head showed numerous cysts in the outer layer of his brain (known as the cerebral cortex), as well as in his brain stem, according to the report, published today (March 27) in The New England Journal of Medicine. He also had cysts in his right eye and testes. [27 Oddest Medical Case Reports]

A man in Indian had numerous tapeworm larvae cysts in his brain, a condition known as neurocysticercosis. Above, MRI images showing cysts in the man's cerebral cortex (left) and brain stem (right). The New England Journal of Medicine

The man was diagnosed with neurocysticercosis, a parasitic disease that occurs when a person ingests microscopic eggs from a pork tapeworm (Taenia solium). When the eggs hatch, the larvae can travel throughout the body, including to the brain, muscles, skin and eyes, where they form cysts, according to the World Health Organization (WHO).

Get Breaking News Delivered to Your Inbox

This tapeworm is common in developing nations, including countries in Latin America, Africa or Asia. Neurocysticercosis is one of the most common causes of seizures around the world.

The illness can be life-threatening and even fatal. The Indian man's case was particularly severe. The sheer number of cysts in his body meant that he couldn't be treated with anti-parasitic medications, which in severe cases like these, can worsen inflammation in the brain and eyes, potentially leading to brain swelling and vision loss, the report said.

The man was treated with steroids and anti-epileptic medications, which are standard treatments for the disease. Unfortunately, doctors couldn't save him, and the man died two weeks later, the report said.

According to the WHO, preventing infections with Taenia solium will require a wide range of public health interventions, including improving sanitation, personal hygiene and food safety, as well as better identification and treatment of patients.

Originally published on Live Science.