KUGOMPO CITY — Economic Freedom Fighters leader Julius Malema was sentenced to five years in prison on Thursday after being convicted of breaking firearm laws by firing a rifle at a political rally in 2018. Magistrate Twanet Olivier delivered the sentence in a court in KuGompo City.

Malema was convicted in October on five counts, including unlawful possession of a firearm and ammunition, discharge of a firearm in a built-up area, and reckless endangerment. The incident occurred at a stadium in the Eastern Cape province. The maximum sentence for the offenses was 15 years.

Malema had pleaded not guilty and argued that the gun was a toy. He said the charges against him were politically motivated and had been brought by Afriforum, a lobby group for the white Afrikaner minority group. Anton Snyman, who was charged alongside Malema, was found not guilty.

Olivier said she considered the magnitude of the offense when determining the sentence. "We hear daily, or weekly, of children playing in the front yards, in the street, who are caught in crossfire, random shots fired, killing people," she said.

Malema's lawyers applied for leave to appeal the magistrate's decision within minutes of it being read out in court. If confirmed after all appeals, the five-year sentence would bar Malema from serving as a lawmaker.

Hundreds of Economic Freedom Fighters supporters wearing red gathered outside the court for the sentencing. The EFF, which is the fourth-biggest party in parliament, said the case was an attempt to silence its leader. Supporters have threatened to protest if Malema is jailed.

A video of the 2018 incident went viral. Malema also appeared in a video shown by U.S. President Donald Trump during a meeting with South African President Cyril Ramaphosa, in which he was singing an anti-apartheid song that some interpreted as calling for violence against Afrikaners.