Scores more victims from the minority community were wounded in Friday's blast, which was claimed by the Islamic State group and appeared designed to further destabilise Afghanistan in the wake of the Taliban takeover.
The regional branch of the rabidly sectarian IS has repeatedly targeted Shias in Afghanistan. It is a Sunni Islamist group like the Taliban, but the two are bitter rivals.
"It was a very terrifying incident," said a teacher in Kunduz, who lives near the mosque.
"Many of our neighbours have been killed and wounded. A 16-year-old neighbour was killed. They couldn't find half of his body."
Images from the scene showed debris strewn inside the mosque, its windows blown out by the explosion. Some men were seen carrying a body draped in a bloody sheet to an ambulance.
A medical source at Kunduz Provincial Hospital said 35 dead and more than 55 wounded had been taken there, while Doctors Without Borders (MSF) said 20 dead and several dozen wounded were brought to its hospital.
Aminullah, an eyewitness whose brother was at the mosque, said: "After I heard the explosion, I called my brother but he did not pick up."
"I walked towards the mosque and found my brother wounded and faint. We immediately took him to the MSF hospital."
Matiullah Rohani, the Taliban government's director of culture and information in Kunduz, confirmed it was a suicide attack, and put the death toll at 46.
The Taliban have been seeking to consolidate power but still face attacks from the regional IS branch, called Islamic State-Khorasan (IS-K).
The Taliban security chief in the northern city accused the mosque attackers of trying to foment trouble between Shias and Sunnis.
"We assure our Shia brothers that in the future, we will provide security for them and that such problems will not happen to them," Mulawi Dost Muhammad said.
Residents of the city, the capital of Kunduz province, told AFP the mosque blast happened during Friday prayers, the most important of the week for Muslims.
One witness, Rahmatullah, said 300 to 400 worshippers were inside.
UN chief Antonio Guterres called for the perpetrators to be brought to justice.
Guterres "condemns in the strongest terms today's horrific attack", the third against a religious institution in Afghanistan in a week, his spokesman said.
Viewed as heretics by Sunni extremists such as IS, Shia Muslims have suffered some of Afghanistan's most violent assaults, with rallies bombed, hospitals targeted and commuters ambushed.
Shiites make up about 20 percent of the Afghan population. Many of them are Hazara, an ethnic group that has been persecuted for decades.
In October 2017, an IS suicide attacker struck a Shia mosque in the west of Kabul, killing 56 people and wounding 55.
And in May this year, a series of bombings outside a school in the capital killed at least 85 people, mostly young girls. More than 300 were wounded in this attack on the Hazara community.
Struggle for legitimacy
Michael Kugelman, a South Asia expert at the Woodrow Wilson International Center for Scholars, told AFP the Taliban would find it difficult to consolidate power unless they tackle terrorism and the growing economic crisis.
"If the Taliban, as is likely, is unable to address these concerns, it will struggle to gain domestic legitimacy, and we could see the emergence of a new armed resistance," he said.
The Taliban are seeking international recognition, as well as assistance to avoid a humanitarian disaster and ease Afghanistan's economic crisis.
The United States will Saturday hold its first face-to-face talks with the Taliban since the withdrawal of American troops.
The US delegation will press the Taliban in Doha to form an inclusive government with broad support, a State Department spokesperson said, stressing it did not indicate Washington recognised Taliban rule.
"We remain clear that any legitimacy must be earned through the Taliban's own actions," the spokesperson said.