Body twitching

So I had sex for the first time but it didn’t last long and it was very painful. After we done it my body kept twitching and I though it would go after a while but 4 hours later it was still twitching not loads but every so often. Has this happened to anyone else after having sex?