His trial had begun in July 2015.
Cheers, and fists pumping the air from scores of Habre’s former prisoners and their supporters greeted the ruling by Judge Gberdao Gustave Kam in a Senegal courtroom.
Habre’s trial, by the Extraordinary African Chambers, is the first in which the courts of one country are prosecuting the former ruler of another for alleged human rights crimes.
He was convicted of being responsible for thousands of deaths and tortures in prisons, during his rule, from 1982 to 1990.
A 1992 Chadian Truth Commission accused Habre’s government of systematic torture, saying 40,000 people died during his rule.
The commission placed particular blame on his political police force.
The ex-dictator, who has lived in Senegal’s capital, Dakar, since he fled Chad in 1990, denounced his trial as being politically motivated.
He and his supporters disrupted proceedings several times with shouting and singing.
He refused legal representation, but the court appointed him Senegalese lawyers.
Chad’s government, led by president Idriss Deby, who served as Habre’s military adviser before forcing him from power, supported the trial.
The trial of Habre was forged by many of those who had been jailed by his government and who have campaigned for his prosecution for more than 15 years.
“This case was not started by a prosecutor in the Hague or by the Security Council.
"The architects, the visionaries of this case, are the Chadian victims themselves and their supporters,” said Reed Brody, counsel for Human Rights Watch, who has been working on the case since 2000.
The work, by the survivors, to bring Habre to justice, influenced all aspects of the trial, including the way the charges were framed, he said.
Habre was first indicted by a Senegalese judge in 2000, but legal twists and turns, over a decade, saw the case go to Belgium and then, finally, back to Senegal, after unwavering pursuit by the survivors.
In 2001, the police force’s archives were discovered on the floor of its headquarters in Chad, records that went back to Habre’s rule and which mention more than 12,000 victims of Chad’s detention network.
The extraordinary court was formed by Senegal and the African Union to try Habre for the crimes that took place during his rule.
A second set of hearings, on damages for the more than 4,000 registered civil parties, will take place in the coming days.
The defence has about 15 days to appeal. If they do, an appeals court must be set up.
Habre was made prime minister of Chad in 1978. He deposed Goukouni Oueddei in a coup in 1982, and became president; the post of prime minister was abolished.