Hussein, 36, was freed at a checkpoint in Baghdad, where he was taken by the military aboard a prisoner bus. He left U.S. custody wearing a traditional Iraqi robe and appeared in good health.
The U.S. military had accused Hussein of links to insurgents, but did not file specific charges. In December, military authorities brought Hussein's case into the Iraqi court system for possible trial.
But an Iraqi judicial panel this month dismissed all proceedings against Hussein and ordered his release. A U.S. military statement on Monday said Hussein is no longer considered a threat.
"I want to thank all the people working in AP. ... I have spent two years in prison even though I was innocent. I thank everybody," Hussein said after being freed.
AP President Tom Curley said Hussein "is safely back with AP and his family, and it is a great relief to us."
"Our heartfelt thanks to all of you who supported us during this difficult and challenging period," Curley said. "Bilal will now be spending some quiet time with his family and resting up."
Hussein and the AP denied any improper contacts, saying Hussein was doing the normal work of a photographer in a war zone. He was detained by U.S. Marines on April 12, 2006 in Ramadi, about 70 miles west of Baghdad.
Hussein was a member of the AP team that won a Pulitzer Prize for photography in 2005, and his detention drew protests from rights groups and press freedom advocates.
"We are happy to welcome him back into our journalistic community," said Santiago Lyon, AP's director of photography.
The photographer was embraced by tearful family members, including his brother and mother, and spoke to other well-wishers on a mobile phone as he was showered with flowers and sweets. He later was honored with a traditional feast.
"I cannot describe my happiness at seeing him again," said his brother, Yassir Hussein, a 35-year-old university professor in Baghdad. "The family has been going through a hard time over the past two years, but now we thank God that we will have some rest."
In New York, the executive director of the Committee to Protect Journalists, Joel Simon, said the group was "thrilled" by Hussein's release.
"He now joins a growing list of journalists detained in conflict zones by the U.S. military for prolonged periods and eventually released without any charges or crimes ever substantiated against them," said Simon. "This deplorable practice should be of concern to all journalists. It basically allows the U.S. military to remove journalists from the field, lock them up and never be compelled to say why."