Men with vitamin D deficiency were more than twice as likely to develop chronic widespread pain as those with the highest levels, researchers from the University of Manchester found.
In the four-year study of 2,313 middle-aged men, one in 15 developed chronic widespread pain. These men were more likely to be depressed, obese, physically inactive and have other health problems.
Researchers said the link between vitamin D and pain was related to the presence of these other risk factors, as the association weakened once these were taken into account.
Nonetheless, they suggested treatment of vitamin D deficiency could help to prevent chronic pain.
Almost half the population has insufficient levels of vitamin D, while chronic widespread pain affects one in five.
Lead researcher Paul McCabe said musculoskeletal pain was a recognised symptom of severe vitamin D deficiency states, such as osteomalacia.
'What is less clear is whether vitamin D deficiency has a role in explaining more common chronic pain symptoms including chronic widespread pain,' he said.
'Our research highlights the complex relationship between vitamin D and factors such as obesity and depression in the development of chronic widespread pain. Further research is required to determine whether treatment of vitamin D deficiency may prevent the development of chronic pain.'
Dr Chris Deighton, president of the British Society for Rheumatology, said: 'This study reveals a number of complex inter-related issues which have extremely important implications for our colleagues in public health in keeping the population as free from widespread musculoskeletal pain as possible.'
The study will be presented at the Rheumatology 2014 conference in Liverpool later this month.