The attack happened in the mountainous Azra district of Logar province, about 25 miles east of the capital, Kabul.
The hospital building was destroyed and people were buried under rubble. Casualties included women, children and elderly.
The Afghan health ministry said the attack was unprecedented and inhumane. Officials blamed the Taleban, but a Taleban spokesman denied responsibility and said it did not target civilians. The blast was caused by "someone with an agenda", he said.
Din Mohammad Darwish, a spokesman for the provincial governor, said more than 25 people were killed and more than 40 wounded in the blast.
According to provincial health director Mohammad Zaref Nayebkhail, the bomber drove up to the clinic in a sports utility vehicle, and security guards tried to stop him entering the compound.
"The driver didn't stop and he entered the compound and reached the main building of the health centre, where the truck detonated," Nayebkhail said.
The force of the blast caused the building housing the ten-bed clinic to collapse, trapping at least 15 people underneath the rubble. People were frantically scouring the debris in search of bodies and survivors, he said.
An emergency response team of nurses, doctors and other provincial officials was due to fly by helicopter to the area to help search for survivors, he added.
The Taleban, which often tries to distance itself from attacks with large civilian casualties, denied responsibility for the bombing.
President Hamid Karzai condemned the attack, in which he said "tens of civilians" were killed. The United Nations said the maternity ward was hit in the bombing.
"This is a despicable attack against civilians who were seeking medical care, as well as visiting family members and health workers," Staffan de Mistura, the UN chief in Afghanistan, said.
Yesterday morning, another blast caused by a bicycle rigged with explosives ripped through a bazaar in the Khan Abad district of Kunduz province in northern Afghanistan, killing at least ten people.
At least 24 other people were wounded in the attack, according to an interior ministry statement.
Meanwhile, Nato said an alliance service member was killed in an insurgent attack in eastern Afghanistan yesterday. Nato did not release any other details about the death.
The death brings to 47 the number of Nato service members killed in June, and more than 200 killed this year.
The attack follows a UN report earlier this month indicating a recent rise in civilian casualties. It said May was the deadliest month for civilians in Afghanistan since records began in 2007, with 368 killed.It added that 2,777 civilians died in 2010, making it the worst year, with three-quarters of the deaths blamed on insurgents.
Meanwhile, Afghanistan's political crisis worsened yesterday, with politicians voting to sack the five most senior judicial officials and international consternation growing after a presidential tribunal threw out a quarter of parliament.
The special court, set up by a decree by Karzai after fraud-marred parliamentary elections last year, ruled on Thursday that 62 politicians would have to be replaced because of alleged poll fraud.
Karzai's critics have said the court was set up after the elections last September, in which Karzai's rivals made major gains, to further his own political agenda. Afghan and western critics have questioned the legality of the court.
Karzai's court announced its new election findings only hours after US president Barack Obama detailed the beginning of a US withdrawal, with 10,000 US troops to return home by the end of this year.