The judge convicted him of rape, sexual slavery and ordering killings during his rule from 1982 to 1990.
Victims and families of those killed cheered and embraced each other in the courtroom after the verdict was given.
It was the first time an African Union-backed court had tried a former ruler for human rights abuses.
Habre, who received strong backing from the US while in power, has been given 15 days to appeal.
Survivors from the Habre era welcomed the verdict.
“This is a historic day for Chad and for Africa. It is the first time that an African head of state has been found guilty in another African country,” Yamasoum Konar, a representative of one of the victims’ groups, told the BBC.
“This will be a lesson to other dictators in Africa,” he added.
After he was sentenced, Habre remained defiant, raising his arms and shouting to his supporters as he was led from the courtroom.
“Down with France-Afrique!” he shouted, using a term which is critical of France’s influence in its former colonies.
Throughout the nine-month trial, he refused to recognise the court’s legitimacy, frequently disrupting proceedings.
The ex-president denied accusations that he ordered the killing of 40,000 people during his rule from 1982 to 1990.
Image caption Habre was alleged to have seized power with the backing of the CIA
His critics dubbed him “Africa’s Pinochet” because of the atrocities committed during his rule.
Survivors had recounted gruesome details of the torture carried out by Habre’s feared secret police.
One of the most notorious detention centres in the capital N’Djamena was a converted swimming pool. [myad]