Sex pain ? ..

Me and my boyfriend just had sex and   I started to have a pain up in my vagina, I don't normally get this pain but sometimes I do, but it hurts afterwards too alittle, and when I put pressure on my lower abdamen. I mean it goes away after a while but I want to know why I have this pain and why it only happens sometimes?