The brazen attack in Logar province, just south of the capital Kabul, also came a day after another bomb blast killed 10 people in northern Afghanistan.
"A suicide car bomb attacker targeted a hospital in Azra district of Logar province," Din Mohammad Darwaish, the Logar provincial spokesman, said of the latest attack.
"The suicide blast killed 30 people and wounded another 45. The casualties are all patients, their visitors and relatives and hospital personnel."
He added: "The blast was caused by an SUV packed with explosives and driven by a suicide attacker.
"The target of the blast is not clear but what is obvious is that a hospital was attacked and civilians were killed."
The head of Logar's provincial council, Abdul Wali Wakeel, confirmed the toll and said local officials had contacted foreign forces to ask for help in evacuating the wounded.
A spokesman for the NATO-led International Security Assistance Force (ISAF) in Kabul said he was "not aware" that ISAF had been approached for assistance.
The Taliban denied it was behind the attack, with spokesman Zabihullah Mujahid saying: "We condemn this attack on a hospital... whoever has done this wants to defame the Taliban."
Militants in Afghanistan frequently target the Afghan police and other government employees as well as foreign forces in their near decade-long insurgency.