Beji Caid Essebsi
Tunisia's President Beji Caid Essebsi poses for a picture in Tunis on 20 February 2017Zoubeir Souissi/Reuters

Tunisia's Parliament has adopted a hotly disputed law giving amnesty to thousands of people linked to corruption under its former authoritarian regime.

Hundreds of demonstrators protested outside the legislature saying they fear a return to Tunisia's pre-Arab Spring past. After an unusually angry debate and opposition walkout over the measure, it passed by 117 votes to nine in a Wednesday night vote.

The full amnesty only concerns those who followed orders from corrupt leaders but did not make personal gains. Those who made money off corrupt dealings can pay back embezzled sums, along with a penalty, in exchange for freedom from prosecution.

President Beji Caid Essebsi — a 90-year-old moderate who served under the former regime — argued the "economic reconciliation" law will improve the investment climate and help the country move forward after a rocky several years following the 2011 Arab Spring revolution. Many of those accused of corruption under former President Zine El Abidine Ben Ali's leadership were important economic players, and Tunisia's economy has struggled ever since his ouster.

But the law's critics say it's a step backward and an effort to whitewash the entrenched corruption that powered the public anger behind the Arab Spring.

Opposition lawmaker Faycal Tebbini accused the president of pushing the law as a favor to those who helped bring him to power in 2014 elections.

The head of the governing Nida Tounes parliamentary group, Soufiane Toubal, argued for passage of the law, pleading for "a tolerant Tunisia that unites all its children and bans hate and rancor."