There is a possibility of strain around the knee muscles or some ligament sprain which might be causing this problem.
Next Steps
I would suggest you to use knee support while walking, start hot fomentation, take analgesic tablet, local analgesic ointment can be applied.
Health Tips
Avoid sitting down, avoid heavy work.