The judge sentenced Ms. Raissouni and Mr. al-Amin to one year in prison, and Dr. Jamal Belkeziz to two years. A second doctor and an office assistant were also found guilty of taking part in the procedure, but the judge gave them suspended sentences.

Ms. Raissouni, wearing a black traditional robe known as a djellaba and a head scarf, showed no outward reaction to the verdict, which drew cries and gasps from others in the courtroom. Several of her friends huddled nearby afterward, crying and consoling each other, then waved goodbye as she was put into a police vehicle and driven away from the courthouse.

The trial was perhaps the most prominent example yet in a pattern of arrests and prosecutions of journalists who are critical of the state, on charges seemingly unrelated to their reporting. Last year, Taoufik Bouachrine, the founder and publisher of Akhbar Al Yaoum, was sentenced to 12 years in prison on sexual assault charges, in a prosecution that the United Nations Working Group on Arbitrary Detention concluded was unfair.

Akhbar Al Yaoum is one of the few independent news outlets in Morocco. Ms. Raissouni has written about human rights and politics, and she has covered demonstrations in the Rif region in the north of the country that resulted in hundreds of arrests.

Her case has sparked protests and a torrent of commentary and criticism online — a rare outburst of public dissent in Morocco, an Arab kingdom on the northwestern coast of Africa. Many called for greater press freedom and for an overhaul of the country’s conservative penal code.