The discovery by British scientists offers hope of developing drugs for the chronic condition.
Around one in four diabetics develop the misery of diabetic neuropathy (PDN) due to high blood sugar.
Symptoms include prickling and tingling sensations as well as sharp, shooting pains and extreme sensitivity to touch in the feet and hands.
This can spread up into the legs and arms. The pain can significantly impair mobility, which in turn exacerbates obesity and worsens type 2 diabetes in a vicious cycle.
The study by King’s College London identifies a protein called HCN2 as being responsible by itself for the complex sensation.
First author Dr Christoforos Tsantoulas, of the Wolfson Centre for Age-Related Diseases, said: “At present we do not have selective drugs which can suppress the activity of HCN2 without affecting other bodily functions, such as the regulation of heart rate.
“This research provides a stimulus for the development of targeted pain drugs that can block HCN2 without affecting the activity of other molecules.”
His team is hopeful the findings published in Science Translational Medicine could lead to treatments which target the source of the pain.
The condition is difficult to treat as the molecular causes are poorly understood.
The study used mice bred to develop a rodent form of diabetes to show over-activity of HCN2 – which initiates electrical signals in pain-sensitive nerve fibres – results in a sensation of pain.
They also found that blocking its activity – or removing it completely from pain-sensitive nerve fibres – stopped the pain entirely.
Senior author Professor Peter McNaughton, based in the same lab, said: “The inexorable rise of obesity worldwide, in both rich and poorer countries, has brought a related increase in type 2 diabetes.
“As many as one in four diabetics suffer from nerve pain, yet there are currently no effective treatments and people therefore typically must resign themselves to a life of continuous suffering.
“Our study reveals the molecular mechanism driving diabetic pain in mice, which we hope will inform future treatments in people with diabetes.”
Diabetes UK says nerve pain can affect sufferers with both type 1 and type 2 forms of the disease.
It most commonly occurs when a patient has prolonged spells of high blood sugar levels.
It is thought that high blood glucose affects the nerves by damaging the blood vessels which supply them.
High blood pressure also has a detrimental effect on the nerves. Smoking and alcohol are also known to increase the risk of nerve pain occurring.
Diabetic nerve pain usually occurs in peripheral regions or extremities, such as feet and legs, hands and arms.
Symptoms can range from mild to extreme. In serious cases the whole area may become numb.
There bare more than 4 million people in the UK living with diabetes – 90 percent of whom have the type 2 form linked to obesity.