I will try my best to answer your query.
It might be muscle spasm or ligamental tear, or may be nerve damage
in any case it will better if you meet orthopedic surgeon.
I also advice you to give rest to the hand for few days and consult physiotherapist for helpful excercises.
Hope my answer will be helpful for you.