Senegal and the African Union have signed an agreement to set up a special tribunal to try Chad's former leader Hissene Habre.
The 69 year old has been been under house arrest since 2005 in Senegal, where he fled after being deposed.
He denies charges of killing and torturing tens of thousands of his opponents.
The charges date from 1982, when Mr Habre came to power in a coup, until he was ousted in 1990.
"Through the agreement, we are setting the procedure by which the trial should take place," said Senegal's Justice Minister Aminata Toure after signing the agreement with African Union representative Robert Dossou in the capital, Dakar.
The deal comes a month after the United Nations highest court, the International Court of Justice, passed a binding ruling that Senegal must begin proceedings to try Mr Habre "without further delay... if it does not extradite him".
Senegal has so far refused four extradition requests.
President Macky Sall, who came to power in March, had indicated that he would be willing to prosecute Mr Habre in a special tribunal.