Phone Turning Off When Charger is Connected

A

AC Question

Currently using a Motorola Moto G. Last night it was working perfectly and put it on the charger to charge it thoughout the night and not working since this morning when I found this problem. The phone works fine until I plug in the charger and the phone turns off straight away. Can not do anything else until I unplug it and isntantly it starts rebooting itself without me doing anything. Tried taking out the SIM card and still has this problem. Anyone could suggest anything?