Need more information before I can give you some suggestion. E.g. how old you are?
There may be chances that you may have sprain your ligaments. It doesn't have to be caused by exercise. There are so many soft tissue in and around the knee, it's not easy to identify which one gives you the pain. If it still bothers you after some rest, maybe you can go and see a physiotherapist.