if it continues, see a doctor...
sounds like Plantar fasciitis
I had it on and off, one thing I learned was to stretch every day to prevent it, but not so much when there is pain.
The pain means it's an injury, so let it heal first and don't do heavy strecting or it may delay the healing.
Once healed, stretch everyday