AL HOCEIMA, Morocco — The house, down a dusty dirt track in a small village near the city of Al Hoceima in northern Morocco, looked dreary outside, with its unpainted facade, but inside the mood was cheery. Friends and family were celebrating the return of a young singer and human rights activist who had just been released from jail.

King Mohammed VI pardoned the young woman, Salima Ziani, 23, late last month after his annual speech commemorating his ascension to the throne, which is usually followed by mass pardons.

Ms. Ziani had been eating dinner with her three cellmates in Oukacha Prison in Casablanca when she was summoned to the office of the prison warden. The warden gave her a flower and said she was free to return to her hometown, Al Hoceima, in the mountainous Rif region along Morocco’s northern coast.

She had been jailed for two months for her role in leading the protests that have been shaking the Rif since the gruesome death of a fishmonger in October. What began as a spontaneous movement calling for a serious inquiry into the tragedy has turned into one of the longest protest movements in the region since the Arab Spring.