Strange battery issue with my HP Compaq CQ 58

I am using HP Compaq CQ58-bf9WM, Laptop 15.6", 320 GB with Windows 2012 server.
Recently I have started facing one strange issue with charging. When I remove the battery from the laptop and connect to the AC power it is not at all turning on. When I keep the battery and connected to AC power as well, the computer is working and charging without any problem. So I understood that there is no problem with my charger. When I keep battery with it and not connected to Charge the battery indicated as full charging only about 40 Sec after that immediately going down to 0% after that it is automatically being turned off.
Can somebody help me figure out what is the issue? Thanks!.
