Algeria has freed the first wave of up to 2,000 Islamic militants due to be released over the next few days.
There was joy at prisons where inmates were released
An amnesty, aimed at promoting national reconciliation, was approved by President Abdelaziz Bouteflika's government last month.
Prisoners fell to their knees as they walked free, while relatives erupted in cries of joy.
The amnesty has been criticised in some quarters for granting the military immunity for prosecution.
The amnesty is the second since President Bouteflika took office seven years ago.
"Up to 2,000 prisoners will be released beginning today and over the next three days," an official source told Reuters.
The amnesty also offers a pardon to militants on the run who surrender, as long as they are not responsible for massacres, rapes or bombings of public places.
"I thank Allah and President Bouteflika. It is like starting a new life. Bouteflika played a big role in that," said prisoner Farid Harizi, 28, on his release from Serkadji prison in the capital Algiers.
The amnesty is an attempt to heal Algeria's wounds after years of a brutal and bloody conflict believed to have claimed more than 150,000 lives.
They include many people who just disappeared.
Human rights groups and families accuse the security forces of abducting some of those who disappeared.
The government strongly denies the allegations, saying some of those who vanished joined the militants.
The conflict erupted in 1992 after the authorities annulled a general election which the Islamic Salvation Front appeared set to win.