BEIJING — A city official in southwest China unleashed a barrage of gunfire on the city’s mayor and Communist Party secretary during a meeting on Wednesday, injuring them before fleeing and killing himself, the official news media reported.

Privately owned guns are rare in China, because of a virtual ban on civilian use, and grisly attacks on officials by colleagues are also uncommon. So rumors of the shooting in Panzhihua, an industrial city in Sichuan Province, rippled quickly across the Chinese internet even before the local authorities confirmed the news.

Panzhihua was built as part of Mao’s plans to relocate factories deep inland, where they would be protected from a feared war. But the violence in this isolated site was nonetheless an embarrassing breach of the efforts by China’s president, Xi Jinping, to remake officialdom into a clean, impeccably disciplined bureaucracy.

Details were sparse, and there were no clues to the gunman’s motives. But the brief initial report in the state media sketched a scene of the head of the Panzhihua Land and Resources Bureau, Chen Zhongshu, bursting into a meeting at an exhibition center and opening fire on officials there.