The present invention is a nerve stimulation system for treating pain in a patient, the system comprising an implantable device (100) having: a housing (18) having a power source; and at least one stimulation electrode (17) arranged on the housing (18) and in electrical communication with the power source, the stimulation electrode (17) adapted to transmit an electrical signal for stimulating at least one nerve cell of the patient, and wherein the power in the power source is wirelessly generated. The fact that the device (100) at least one stimulation electrode (17) arranged on the housing (18) advantageously provides a compact and miniature device for simple, minimally invasive implantation into a patient to treat pain. The size of said device (100) allows it to work with commomly used injectors such as a standard medical syringe and a stainless steel needle. Further, the device (100) can be powered wirelessly, which allows said device (100) to be implanted for a long period of time.