Encephalitis is an inflammation of the brain. The most common cause is a virus, but it can also be caused by bacteria and fungi. The condition is called primary encephalitis if the virus attacks the brain directly, and secondary if the virus first attacked another part of the body and spread to the brain.