RABAT, Morocco — The leader of protests over economic and social problems in Morocco’s northern Rif region was sentenced to 20 years in prison, provoking outrage among his family and activists.

A court in Casablanca convicted the protest leader, Nasser Zefzafi late Tuesday on charges of undermining public order and threatening national unity. A number of other activists were also jailed for up to 20 years.

Mr. Zefzafi was arrested in May 2017 after organizing demonstrations in his hometown Al Hoceima in the Rif. The protests began after Mouhcine Fikri, a poor fishmonger, was crushed to death in October 2016 while trying to retrieve fish from a trash compactor. Authorities had confiscated his stock and tossed it into a garbage truck.

His death unleashed building anger over economic deprivation and humiliation suffered by the Berbers in the historically neglected Rif region. Protests spread across rural Morocco, where many feel the powerful coterie of those who enjoy royal patronage corruptly profits at the expense of the people.