The near-simultaneous explosions happened at about midday (07:30 GMT).
Fifty-four people were killed in the blast, said health ministry spokesman Norughli Kargar, while 150 were injured.
"It was very loud. My ears went deaf and I was blown three metres [yards]," Mustafa, who uses only one name, told Associated Press news agency.
"There was smoke and red blood on the floor of the shrine. There were people lying everywhere."
Amid the chaos straight after the blast, a young girl, dressed in a green shalwar kameez (traditional dress) smeared in blood, stood shrieking, surrounded by the crumpled, piled-up bodies of children, AFP reported.
Afghan President Hamid Karzai spoke of the unprecedented nature of the attack, saying it was "the first time that, on such an important religious day in Afghanistan, terrorism of that horrible nature is taking place".
No-one had claimed to have carried out the attacks, said Mohammad Zahir, head of Kabul's criminal investigation department.
A Taliban statement said the group had not been behind either incident.
Police said they foiled another attack elsewhere in the capital.
The bomb which exploded near the main mosque in Mazar-i-Sharif was apparently strapped to a bicycle, and went off shortly after the Kabul blast.
Balkh province Deputy Police Chief Abdul Raouf Taj said the device exploded as a convoy of Shias, shouting in celebration of Ashura, passed by, AP reported.
At least 17 people were injured.
Elsewhere, police said at least three people were wounded by a motorcycle bomb in the southern city of Kandahar, the Taliban's heartland - but it appears to have been unconnected to the other two attacks.
Mohammad Bakir Shaikzada, the top Shiite cleric in Kabul, said he could not remember a similar attack on such a scale.
"This is a crime against Muslims during the holy day of Ashura," he told AP.
"We Muslims will never forget these attacks. It is the enemy of the Muslims who are carrying them out," he said, though he would not speculate on who might be responsible.
There are tensions between Sunni and minority Shia Muslims in Afghanistan, but violence of the type seen in Pakistan or Iraq is rare, the BBC's Quentin Sommerville in Kabul says.
Over the past decade Shias in Afghanistan have celebrated their festivals more confidently, openly and on a bigger scale than ever before.
The attacks come a day after an international conference on Afghanistan's future was held, in the German city of Bonn.