It seems like you have a tendon injury
. I need you to follow this regimen for you to get treated:
First of all I want you to rest the affected area. This does not mean totally stop but you can start light activities like swimming and such which will not cause you much discomfort. Then you can ice the area till it is just numb and then stop. Then, Compress the area by tying a crepe bandage around it. Lastly, elevate the leg while lying down to above the heart level. This will reduce swelling in the area.
If after doing all this for about a week, the pain does not go down, you may have something more serious and you need to consult an orthopedician so that you can be cured as early as possible. I hope this helps.