painful sex

I've had an IUD for about two years now and recently sex had been starting to hurt whenever my partner goes too deep. Could it be the IUD or is something else wrong?