Nouri Maliki said those freed would be people with no clear evidence against them or who were arrested by mistake.
More than 100 prisoners were brought to
About 29,000 prisoners are believed to be held in US- and Iraqi-run jails.
Correspondents say this is expected to be one of the biggest releases of prisoners since US-led forces invaded the country in 2003 to topple Saddam Hussein.
As they stepped out of the buses, some released prisoners wept and kissed the ground while others smiled and waved at waiting relatives.
Accused
"You are rejoining society now and you will serve your society and mix again with people," said Mr Juburi, who is the human rights director for the Iraqi Islamic Party.
"We will exert the utmost efforts to release detainees and bring a smile back to prisoners' faces," he added.
Most prisoners are believed to be held on suspicion of involvement in the insurgency that has gripped the country since 2003.
"I spent 16 months in jail without any specific reason. They only questioned me once, accusing me of funding terrorism," said one of the released detainees.
In the latest attacks:
Meanwhile, at least 15 people from a group of 50 who were kidnapped in
They were sitting together on a street in central
Photo Caption
Iraqi PM Nori Al-Maliki