Chad's former dictator Hissene Habre raises his hand during court proceedings in Dakar, Senegal, Monday, May 30, 2016.  Judge Gberdao Gustave Kam declared Habre guilty and sentenced him to life in prison for crimes against humanity, war crimes and torture, in a packed courtroom, Monday.(AP Photo/Carley Petesch)Carley Petesch
Chad's former dictator Hissene Habre raises his hand during court proceedings in Dakar, Senegal, Monday, May 30, 2016. Judge Gberdao Gustave Kam declared Habre guilty and sentenced him to life in prison for crimes against humanity, war crimes and torture, in a packed courtroom, Monday.(AP Photo/Carley Petesch)Carley Petesch

Former Chad dictator Hissene Habre was found guilty Monday of crimes against humanity, war crimes, torture and sex crimes during his rule and he was sentenced to life in prison, ending a trial more than 15 years in the making.

Victims, former prisoners and their relatives broke out into whoops of joy, hugs and tears in the courtroom when ruling was announced by the three-judge panel in the special court in Senegal.

A defiant Habre raised his fist and shouted to his supporters: โ€œLong live independent Africa! Down with France-Africa!โ€

He was convicted of being responsible for thousands of deaths and torture in prisons while in power from 1982 to 1990. A 1992 Chadian Truth Commission accused Habreโ€™s government of systematic torture, saying 40,000 people died during his rule. It placed particular blame on his police force.

The trial began in July 2015, but victims and survivors have been pursuing the case against their former leader for more than 15 years.

Judge Gberdao Gustave Kam, speaking for the panel, said evidence showed Habre was directly responsible, having given the orders and having also committed some of the crimes himself.

The accusations of rape came out during witness testimony at the trial.

A second set of hearings to determine damages for the more than 4,000 registered civil parties will take place in the coming days.