Rwanda’s Supreme Court has upheld a law that says defaming the president is illegal, but ruled that drawing cartoons or producing writing that “humiliates” a government official is no longer a crime.

The Rwanda Journalists Association had challenged parts of the penal code that criminalized the publishing of such cartoons with a punishment of up to four years in prison.

A three-judge panel decided the provisions contravene freedom of expression.

The association’s executive secretary, Gonza Muganwa, welcomed the ruling, he said it removes a major obstacle to press freedom in the East African nation.

Defaming the president, however, remains illegal, with a punishment of five to seven years in prison and a fine.