Definitely sounds like a cramp and yes, I've had them bad. For me, they go away when I stop riding but some folks report that their leg will seize up hours after they quit.
There are roughly 800 opinions on how to prevent cramps, pick one and try it.