KABUL, Afghanistan — A suicide bomber struck in northern Afghanistan on Friday morning, killing at least 45 people, just as worshipers were emerging from a mosque to celebrate the first day of Id al-Adha, the most important Muslim holiday, officials said. It was one of several attacks in Afghanistan on Friday, and by far the most lethal.

The attack, in Maimana, the capital of Faryab Province, also wounded 60 people.

Among the dead were 25 members of the Afghan national security forces, including the commander of the Afghan National Civil Order Police for Faryab, the head of the police quick-reaction force and the chiefs of police for two districts of Maimana, said Naqibullah Faiq, a member of Parliament from Faryab.

President Hamid Karzai condemned the attack. “Those who are taking away the happiness of Muslims during the Id al-Adha days are the enemies of Islam, and you cannot call them human or Muslim,” he said in a statement.

Dr. Maroof Samar, a surgeon at a government hospital, said, “The hospital is overwhelmed by dead and wounded bodies; all off-duty doctors were called in.” Dr. Samar said he ran to the hospital from the mosque, where he was among the worshipers.