The invention refers to the use of a sigma ligand, particularly a sigma ligand of formulae (I), (II) or (III) to prevent and/or treat acute and chronic pain developed as a consequence of surgery, especially superficial and/or deep pain secondary to surgical tissue injury, and peripheral neuropathic pain, neuralgia, allodynia, causalgia, hyperalgesia, hyperesthesia, hyperpathia, neuritis or neuropathy secondary to surgical procedure.