Sex on period

I've recently had sex towards the end of my period two days ago and now that my period is ending completely I'm still having lower abdominal pain and lower back pain as if I were still heavily on my period. I've never tried having sex while on my period so I don't know if this is normal. Can anyone help please?