Osteomyelitis is a bone infection caused by bacteria or fungi. It causes painful swelling of bone marrow, the soft tissue inside your bones. Without treatment, swelling from this bone infection can cut off blood supply to your bone, causing bone to die.