First would be rest from squatting for at least 7 to 10 days. Try working around the injury. If you felt warmth or heat around the injury that may suggest a slight (hopefully) muscle/tendon pull. Rest heals this the best, usually. Also might suggest a linking ab wall problem.
Check your shoes, foot stance, unexpected shift of the bar/weight on the shoulders when squatting. If you squat on a Smith machine, this may be a root cause. OK for short range squatting (1/2, 1/4, etc) but some experience trouble with full ROM in this regard. Smith's do not always present a problem right away. Sometime month's go by trouble free, but it seems the more weight added over those months things can develop in a negative way. Some never have a problem, but others can without warning. Good Luck.
Thanks Jpm, but I feel that I have been not doing adequate warm ups from couple of months or I might have hastily done my set .I never done squat on a smith machine ,I dont know was never comfortable with it.I have to go back and see my foot position and placement of bar accodingly,took a painkiller last night and it feels better and hopefully the inflamation should reduce