I've had this issue and solved it twice now. It is very important you let the battery calibrate by charging it to 100% and leaving it still charging for several hours. First however, if you're having problems charging it or turning it on, leave it overnight not plugged in and turned off then try connecting it to a gentle power supply like USB from your computer. Charge it all day and then don't let it drop below 20% until battery is properly calibrated.
If you have another sudden discharge however, its probably better to get a replacement as it may damage the voltage circuitry of the phone.