Neurosyphilis is a bacterial infection of the brain or spinal cord. It usually occurs in people who have had untreated syphilis for many years.