Does Exercise Help Relieve Period Cramps?

I was once told that exercise can help with cramps. Is this true? Also what can I do when im at school and I have really bad period cramps? Please Help.