Sex on period

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