The online postings were from a disturbance late Sunday that shut down a manufacturing facility in Taiyuan in north China, where 79,000 workers were employed. State-run news media said 5,000 police officers had to be called in to quell a riot that began as a dispute involving a group of workers and security guards at a factory dormitory. The unrest was noteworthy because the factory site is managed by Foxconn Technology, one of the world’s biggest electronics manufacturers and an important supplier to companies like Apple, Dell, Microsoft and Hewlett-Packard. A spokesman for Foxconn said the company was investigating the cause of the incident. But analysts say worker unrest in China has grown more common because workers are more aware of their rights, and yet have few outlets to challenge or negotiate with their employers. When they do, though, the results can be ugly and, because of social media and the Web, almost instantly transmitted to the world in their rawest and most unfiltered form. “At first it was a conflict between the security guards and some workers,” said a man who was reached by telephone after he posted images online. The man said he was a Foxconn employee. “But I think the real reason is they were frustrated with life.” The company said that as many as 2,000 workers were involved in the incident but that it was confined to an employee dormitory and “no production facilities or equipment have been affected.” Nonetheless, the plant was closed, the company said. Foxconn, which is based in Taiwan and employs more than 1.1 million workers in China, declined to say whether the Taiyuan plant made products for the Apple iPhone 5, which went on sale last week. A spokesman said the factory supplied goods to many consumer electronics brands. An employee at the Taiyuan plant said iPhone components were made there. Supply-chain experts say most Apple-related production takes place in other parts of China, particularly in the provinces of Sichuan, Guangdong and Henan. Apple referred questions to Foxconn. Labor unrest in Taiyuan, in northern China’s Shanxi Province, comes as strikes and other worker protests appear to be increasing in frequency this year compared with last year, said Geoffrey Crothall, spokesman for the China Labor Bulletin, a nonprofit advocacy group in Hong Kong seeking collective bargaining and other protections for workers in mainland China. Many of the protests this year appear to be related to the country’s economic slowdown, as employees demand the payment of overdue wages from financially struggling companies, or insist on compensation when money-losing factories in coastal provinces are closed and moved to lower-cost cities in the interior. But the level of labor unrest in China this year has not yet matched 2010, when a surge in inflation sparked a wave of worker demands for higher pay, Mr. Crothall said. The Taiyuan protest comes at a politically delicate time in China, with a Communist Party Congress expected in the coming weeks to anoint a new general secretary and a new slate of members for the country’s most powerful body, the Standing Committee of the Politburo. The government has been tightening security ahead of the conclave through measures like restricting the issuance of visas and devoting considerable resources to watching and containing disturbances like the recent anti-Japanese demonstrations. But the calendar may also be on Foxconn’s side. A weeklong public holiday starts this weekend to mark the country’s national day on Oct. 1. Factories across the country will close to allow workers to go home — and in the case of Foxconn’s Taiyuan factory, the dispersal of workers to hometowns could allow tempers to cool. Mr. Crothall said that while the cause of the latest dispute in Taiyuan remained unclear, his group had found an online video of the police there using a megaphone to address “workers from Henan” — the adjacent province to the south of Shanxi. The police officer said that the workers’ concerns would be addressed. Disputes involving large groups of migrant workers are common in China. In some cases, workers protest after believing that they have been promised a certain pay package and traveled a long distance to claim it, only to find on arrival that the details were different from what they expected. In other cases, workers from different provinces with different cultural traditions coming together in a single factory have clashed over social issues or perceived slights. The disturbance is the latest problem to hit Foxconn. Foxconn, which is part of Hon Hai Group of Taiwan, has been struggling to improve labor conditions at its China factories after reports about labor abuse and work safety violations. Apple and Foxconn have worked together to improve conditions, raise pay and improve labor standards, particularly since March when the Fair Labor Association, a monitoring group invited by Apple to investigate conditions, found widespread problems. Mr. Crothall said workers in China had become emboldened. “They’re more willing to stand up for their rights, to stand up to injustice,” he said, adding that damage to factory buildings and equipment still appeared to be unusual, occurring in fewer than 1 in 20 protests. The same Taiyuan factory was the site of a brief strike during a pay dispute last March, the Hong Kong news media reported then. Social media postings suggested that some injuries might have occurred when people were trampled in crowds of protesters.