One of the most common causes of this type of insomnia
called middle insomnia is depression
with pain also doing this.
The other type of insomnia associated with depression is terminal insomnia which is where you wake up earlier than your normal wake time. Besides the medical evaluaton, have your doctor screen you for depression.