Every time something like this happens, more often than not, it's the battery. If possible, try another one (from a friend, or maybe you have an extra one?). Definitely try another one BEFORE actually buying one. Another way to tell is to check if the battery is bloated. Lay it flat on a table, and if it bobbles or can roll around (as in 'not flat at all') then it's definitely a dying battery.
It could also be that something is creating a short circuit inside the phone (most likely the USB port or the charging circuitry).
BOTH SITUATIONS are very dangerous to your phone and yes, call me paranoid, but even to you. Both are fire hazards if you continue to use a phone with a bad battery or faulty charging circuitry.