Sounds like an electrical problem with either your ignition or fuel system.

Also try to check the cylinder head gasket if it's damaged.