Chronic pain is a refractory health disease worldwide causing an enormous economic burden on individuals and society. Accumulating evidence suggests that inflammation in the peripheral nervous system (PNS) and central nervous system (CNS) is the major factor in the pathogenesis of chronic pain. The inflammation in the early- and late phase may have distinctive effects on the initiation and resolution of pain, which can be viewed as friend or foe. On the one hand, painful injuries lead to the activation of glial cells and immune cells in the PNS, releasing pro-inflammatory mediators, which contribute to the sensitization of nociceptors, leading to chronic pain; neuroinflammation in the CNS drives central sensitization and promotes the development of chronic pain. On the other hand, macrophages and glial cells of PNS and CNS promote pain resolution via anti-inflammatory mediators and specialized pro-resolving mediators (SPMs). In this review, we provide an overview of the current understanding of inflammation in the deterioration and resolution of pain. Further, we summarize a number of novel strategies that can be used to prevent and treat chronic pain by controlling inflammation. This comprehensive view of the relationship between inflammation and chronic pain and its specific mechanism will provide novel targets for the treatment of chronic pain.