Yu Yingsheng was freed after an appeals court in the eastern province of Anhui ruled the evidence had been inadequate for a guilty verdict, the official Xinhua news agency said.
His wife was murdered in late 1996 and Yu was convicted of homicide, with the verdict upheld on appeal. Yu and his father pressed further appeals until the provincial high court ordered a retrial this May.
Yu's 17 years in jail have left him in poor health, Xinhua cited a local police source as saying.
They came in the face of mounting public concerns over the fairness of China's justice system -- long criticised by overseas rights groups -- following the overturning of several convictions.
Xinhua cited the cases of two men sentenced to death and life in prison in 2004 for the alleged rape of a 17-year-old girl in eastern China, and acquitted at a retrial in March this year.
The agency said the guideline "advocates" the principle of "innocent until proven guilty" and acknowledged that Chinese law enforcement personnel "sometimes have to compromise the law when facing pressure from their superiors".
Critics say there are numerous abuses in China's legal system, including the widespread use of the death penalty and re-education through labour, which gives police the right to hand out sentences of up to four years without a judicial trial.
Premier Li Keqiang said in March that the re-education through labour system would be "reformed", without giving further details.
