Tunisia's parliament on Wednesday approved a controversial law granting amnesty to officials accused of corruption during the rule of autocrat Zine El-Abidine Ben Ali, triggering angry protests from the opposition and activists outside.

Opposition lawmakers sang the national anthem and shouted slogans before the session was temporarily suspended. Outside, dozens of demonstrators chanted "This law will not pass" and "Whitewash corruption".

The law was approved by 117 deputies. The opposition withdrew from the session in protest against the insistence of the ruling coalition on passing the law in an extraordinary session.

"I congratulate you on the return of the dictatorial state and reconciliation with the corrupt," Ahmed Seddik, a deputy of the Popular Front, said.

This law is an advanced stage of counter-revolution - Ammar Amroussia, opposition lawmaker

"Tunisians will not forgive you," he added.

After months of protests, the bill was amended from an original draft which would have also granted amnesty to corrupt businessmen. As it stands, they will be liable to prosecution for crimes committed during Ben Ali's 24-year rule.

Witnesses said police beat protesters who had shouted slogans against the president and the ruling parties, Ennahda and Nidaa Tounes, which supported the law.

"The opposition no longer has a pretext, they resorted to unacceptable methods. They rejected democracy," Sofian Toubel, a lawmaker from Nidaa Tounes, said.

Critics of the so-called "Economic Reconciliation" Law say it is a step back from the spirit of Tunisia's 2011 revolution to oust Ben Ali, who fled after weeks of protests against corruption and inequality.

"This law is an advanced stage of counter-revolution," opposition lawmaker Ammar Amroussia said.

A fresh start?

But government officials say the law helps to turn the page on the past, improves the climate for investment and gives confidence to the administration and officials.

"The time has come to stop the isolation of those officials who could contribute to the building of the new Tunisia," said Mohamed Souf of the governing Nidaa Tounes party. "We must reconcile, as happened in South Africa and Rwanda."

We must reconcile, as happened in South Africa and Rwanda - Mohamed Souf, of the governing Nidaa Tounes party

The bill was proposed by President Beji Caid Essebsi, himself a former Ben Ali official, and sent to parliament in 2015. But debate was postponed after criticism that the original bill benefited business elites tied to the government.

At Wednesday's session, tensions flared between the ruling coalition and the opposition lawmakers, who said the Supreme Judicial Council had not yet given its answer after being consulted by the parliament on the legality of the bill.

Despite the consensus between secular and Islamist parties that helped the country's transition towards democracy, the bill has divided Tunisians between those who want to draw a line under the past and those who say they must deal with past graft.

Since the 2011 uprising, Tunisia has been held up by Western partners as a model of democracy for the region. Economic progress has lagged, though, and corruption remains a major problem in the North African state.