Imaginechina This photo of beggars being confined in a cage during a local fair in China provoked outrage when it was posted on Weibo, China's most popular version of Twitter.

BEIJING – With more than 100,000 pilgrims and visitors expected to attend the annual Xishan Wanshou Palace Temple Fair, authorities thought it would be a good idea to confine the local beggars in one spot.

So, more than 100 beggars from the town of Xishan, in China’s southern Jiangxi province, were placed in a 165-foot-long iron cage during the fair on Sept. 15.

But when pictures of the beggars in the cage were posted on Sina Weibo, China’s most-popular version of Twitter, there was an outpouring of criticism online. Most netizens were furious.

One micro blogger wrote, “It’s just like a zoo. This is trampling their dignity.”

Another blogger sarcastically chimed in, “Our government always boasts that China has the best record on human rights. Before I did not believe that, but today I am convinced. These officials are just too smart, treating people as dogs.”

Others thought the pictures are too ridiculous to be true.

Stay informed with the latest headlines; sign up for our newsletter

So NBC News called the civil affairs office of Xinjian prefecture government, which oversees the annual fair at the Taoist temple in the town of Xishan, to verify the photos were real. Mr. Wan, head of the civil affairs office, acknowledged that the photos were in fact real and told NBC News that it was the best solution the government could find for the problem so far.

“We had to consider both sides: the pilgrims and the beggars. There are some fake beggars who just want to trick money from pilgrims. We did see the pilgrims were harassed by such beggars in the past. On the other hand, the temple fair is so crowded that beggars might be hit by cars or trampled by the crowd,” said Wan.

Cities and towns across China hold fairs in or near the local Taoist or Buddhist temple usually once a year, or in some instances monthly. In this case, the town of Wanshou was holding its annual fair, hence the preparation for big crowds.

Xinjian government also made a statement on its official Weibo account saying: “In order to avoid accidents, we provided this temporary rescue shelter whose two exits are open. All the beggars voluntarily entered it.”

Watch World News videos on NBCNews.com

Many netizens were not satisfied by the answer and believe it was just an excuse by government officials to justify their behavior.

One blogger posted, “Despite any reasons they may have, the moment the government locked the beggars in the cage, they had already stripped away these people’s dignity.”

To many Chinese, the photos also damaged their impression of temple fairs. For centuries, the temple fair, “Miao Hui” in Chinese, has played a unique role in ordinary Chinese daily life. It originated in ancient times when people offered sacrifices to gods, but later it gradually turned into a marketplace for people to exchange goods and a place to see cultural performances.

During the last 10 years, the Chinese government has encouraged the fairs in order to emphasize traditional values. But this incident has left a bad impression of local officials and how they organize the events.

One blogger wrote: “What should be caged is power.”

More world stories from NBC News:

Follow World News from NBCNews.com on Twitter and Facebook