A purported armed group in Iraq released a videotape message on Saturday indicating the release of the workers.
The video, which surfaced in the western city of Ramadi, showed the eight men standing or kneeling in two rows in the desert, holding their passports open.
"Based on the goodwill gesture by the Chinese government, which included a state ban on Chinese entering Iraq, the Numaan Brigades have decided to release the eight," the speaker on the tape said.
China's embassy in Baghdad later confirmed that the eight had been released, the official Xinhua news agency said.
On the tape, a man with his face covered with a traditional chequered headdress shook hands with each of the captives before they walked off camera.
The speaker in the video said no ransom had been paid and the captives had not been harmed during their captivity.
"Based on the goodwill gesture by the Chinese government, which included a state ban on Chinese entering Iraq, the Numaan Brigades have decided to release the eight"
A voice on the released video
On 18 January, the group holding the men said it would kill them within 48 hours unless Beijing - which opposed the war in Iraq - explained what they were doing in the country.
The group later demanded that China ban its nationals from entering or remaining in Iraq, where around 100 foreigners have been captured and at least 30 killed.
The captors suggested the eight, who were all from the same poor, rural county in the south-eastern coastal province of Fujian, were working for a US contractor but were trying to leave Iraq after failing to find work, a foreign ministry spokesman said.
China said the men had been working at a textiles factory in the southern city of Najaf and were seized as they were leaving the country in a taxi on their way home for the Chinese new year.
China issued a humanitarian call on Friday to their captors to release the men, repeating its advice to Chinese citizens to stay away from Iraq.
Thousands of Asians, including Chinese, are employed by private contractors working for the US military and various companies.