Don't let others scare you. This isn't a battery problem.
It was very likely the CPU that was getting hot, not the battery. The CPU was processing something at 100% load for a long period of time, naturally, warming it (and the exterior of the phone) up. It took some time to respond to you...