Coffee at 3pm or later fucks up your sleep?

Had a long day, and espresso around 3pm and fell asleep pretty quickly, but my sleep was troubled? Lots of random nightmares?