State television and anti-government activists earlier had reported 15 dead. The television said a "terrorist suicide blast" hit the Iman Mosque in central Damascus, and Mohammed al-Buti, imam of the ancient Ummayyad Mosque , was among the dead.
"The death toll from the suicide bombing of the Iman Mosque in Damascus is 42 martyrs and 84 wounded," the health ministry said later in a statement. While attacks in the capital during Syria's two-year-long rebellion have become almost commonplace, an attack on a mosque was deeply shocking to both sides in the conflict.
Buti, a government-appointed cleric reviled by the Syrian opposition movement, delivered the official weekly Friday mosque sermons on state television. In one of his televised speeches, Buti described those fighting to topple President Bashar al-Assad as 'scum'. He also used his position to call on Syrians to join the armed forces and help Assad defeat his rivals in the rebellion.
Rebel spokesman Loay Maqdad said units associated with the opposition's Free Syrian Army were not behind the attack. "We in the Free Syrian Army do not take any responsibility for this operation. We do not do these types of suicide bombings and we do not target mosques," he told Al Arabiya television.
Video released by Syria's al-Ikhbariya channel showed dozens of limp bodies lying on the bloodied carpet of the mosque , as emergency workers rushed in to give survivors first aid. Mangled limbs lay among the wreckage.
The British-based Syrian Observatory for Human Rights, which has a network of activists across Syria, said earlier that around 15 people died in the blast in central Damascus. The Observatory said it was unclear if the explosion was caused by a car bomb or a mortar shell. Dozens more were wounded in the attack it said.
The Iman mosque is next door to the offices of Assad's ruling Baath party, as well as other government compounds.
Locals were panicked after the blast and described seeing ambulances rushing to the area while traffic came to a standstill. Residents near the mosque said the strong, acrid smell of gun powder still hung in the air.