It's an affliction that keeps millions awake at night, tossing and turning as they struggle to nod off.
But new research has discovered the way people think about sleep is key to curing chronic pain and could help them get a better night's shut-eye.
Those who believe their discomfort will keep them up all night are more likely to have insomnia - causing worse pain, scientists found.
In a viscous cycle for the sleep-deprived, better sleep patterns help to reduce pain - especially after receiving cognitive behavioural therapy, the study found.
Chronic conditions, including fibromyalgia, and arthritis are directly linked to negative thoughts about sleeping issues and pain and can be managed through therapy, experts say.
Researchers from the University of Warwick created a scale to measure beliefs about sleep and chronic pain in long-term patients.
Participants quality of sleep was also assessed in the first study of its kind to explore the cycle between sleep and pain.
The scale, known as PBAS, was tested on four groups of patients suffering from long-term pain and bad sleeping patterns.
They found people who believe they won't be able to sleep due to their intense discomfort are more likely to suffer from insomnia.
Dr Nicole Tang, co-author, said: 'Thoughts can have a direct or indirect impact on our emotion, behaviour and even physiology.
'The way how we think about sleep and its interaction with pain can influence the way how we cope with pain and manage sleeplessness.
'Based on clinical experience, whilst some of these beliefs are healthy and useful, others are rigid and misinformed.
'The new scale is developed to help us pick up those beliefs that have a potential role in worsening the insomnia and pain experience.'
Lead researcher Esther Afolalu believes the scale could be used by therapists to identify and monitor rigid thoughts about sleep and pain.
She said it could be used to help sufferers get more effective treatment for insomnia.
Miss Afolalu added: 'Current psychological treatments for chronic pain have mostly focused on pain management.
'They have had a lesser emphasis on sleep but there is a recent interest in developing therapies to tackle both pain and sleep problems simultaneously.
'This scale provides a useful clinical tool to assess and monitor treatment progress during these therapies.'