Images of a 92-year-old woman living behind bars in a pigsty have incensed Chinese social media users.

The elderly woman had reportedly been kept in the padlocked 10sqm cell for years and slept on a wooden bench. Images showed her emaciated frame and the bare, breeze-block walls of the enclosure.

The Southern Morning Post, which covers China's Guanxi region, reported that the woman's son said she had volunteered to move into the cell because her incontinence had "given them a great burden and she was worried about making the house smell".

According to the Post, on hearing reports of the woman's condition the government of her township began an investigation and visited with relief supplies.

The son and daugher-in-law of the woman, whose surname is Yang, were ordered to let her move back into their home.

She was taken to Fengshan County People's Hospital for treatment, after medical workers examined her at the dwelling.

A video of the woman posted online has reportedly been viewed more than 1.8m times.

Online forum users spoke of their tears and "heartache" after reading the story.