In many cases, osteomyelitis can be effectively treated with antibiotics and pain medications. If a biopsy is obtained, this can help guide the choice of the best antibiotic. The duration of treatment of osteomyelitis with antibiotics is usually four to eight weeks but varies with the type of infection and the response to the treatments. In some cases, the affected area will be immobilized with a brace to reduce the pain and speed the treatment. Sometimes, surgery may be necessary. If there is an area of localized bacteria (bone abscess), this may need to be opened, washed out, and drained. If there is damaged soft tissue or bone, this may need to be removed. If bone needs to be removed, it may need to be replaced with bone graft or stabilized during surgery.