This happens to me often after a squat. You probably have a pinched nerve in your spine. It's due to the weakest part of your body having to take the most pressure (in this case your lower back). Go to a good chiropractor for an adjustment and you'll feel a million times better. Your insurance will most likely cover this. I get adjusted about once a month even when I don't hurt too much just to feel better.
And then next time squat less weight or use other leg exercises.
And then next time squat less weight or use other leg exercises.