I've had this exact problem especially on nights before important or stessful events the next morning such as job interviews.
At first, the anxiety of the interview is what keeps me up. Then, as it gets later and I check the clock, I get stressed about the lack of sleep I'll have the next day.
Sometimes getting up, going to another room and getting a glass of water before returning to bed and resetting the process has helped.