Senegalese MPs have passed a law that will allow a special African Union tribunal to be created to try Chad's former leader Hissene Habre.
The 70 year old has been under house arrest since 2005 in Senegal, where he fled after being deposed in 1990.
He denies killing and torturing tens of thousands of his opponents.
The BBC's Thomas Fessy in Senegal says it is a major breakthrough for human rights groups, which have been pushing Senegal to try Mr Habre for decades.
There have been years of wrangling in Senegal over what to do about Mr Habre, with the government of former President Abdoulaye Wade changing its position on whether to try him several times.
''In eight months, [President] Macky Sall's government has accomplished more to reward the perseverance and tenacity of Habre's victims than Senegal had over the course of two decades," Reed Brody from the US-based Human Rights Watch said in a statement.
The charges date from 1982, when Mr Habre came to power in a coup, until 1990, the year he was ousted.
The National Assembly passed the law following a deal in August between the AU and Senegal setting out international funding for the tribunal.
An aide at the justice ministry told the BBC the AU would now begin appointing judges put forward by the justice minister.
The tribunal's president would be from elsewhere in Africa and investigations into the case would last 15 months, after which a decision would be made about whether to charge Mr Habre, he said.
Dubbed "Africa's Pinochet", Mr Habre was first indicted in Senegal in 2000 - but the country's courts ruled at the time that he could not be tried there.
His alleged victims then filed complaints under Belgium's universal jurisdiction law, which allows the country's judges to prosecute human rights offences committed anywhere in the world.
He was charged by Belgium with crimes against humanity and torture in 2005, but Senegal has refused four extradition requests.
In July the United Nations' highest court, the International Court of Justice, passed a binding ruling that Senegal should begin proceedings to try Mr Habre without delay if it did not extradite him to Belgium.
MP Cheikh Seck said he voted for the law because it would show that Africa could hold its own leaders accountable.
"It's not up to the West to try Hissene Habre. It's why I voted in favour of this law," he told the Associated Press news agency.
Mr Habre and his wife have kept a low profile in Dakar, where he has lived in relative freedom, guarded by two security agents. He has occasionally been seen at a mosque for Friday prayers.
A plan last year to repatriate Mr Habre to Chad, where a court in 2008 sentenced him to death in absentia for planning to overthrow the government, was stopped following a plea from the UN.
A 1992 Truth Commission in Chad accused Mr Habre of being responsible for widespread torture and the deaths of 40,000 people during his eight-year rule.
He was accused of carrying out a deliberate policy of terror to discourage any opposition.
Survivors of torture say that, among other things, they were subjected to electric shocks, near-asphyxia and "supplice des baguettes", when their heads were squeezed between sticks.