Lower back

Hi! I’m running the Love Run in March as my second half marathon. I trained 10 miles during my first training cycle, which was for the Philly Half in November. After mile 11 during the race, I started to get burning lower back pain. By mile 13 it felt like a massive back spasm from my shoulders down to my lower back. I was able to continue running; it was just very uncomfortable. As soon as I finished, it went away. Is there something I can do this training cycle to prevent that from happening? Was it just dehydration? For context, I didn’t do much strength training last cycle so maybe I need to work on my core?? Thank you for any advice!