MEXICO CITY — Before the police or news reporters had even arrived at the underpass outside Veracruz where gunmen held up traffic and dumped 35 bodies at rush hour last week, Twitter was already buzzing with fear and valuable information.

“Avoid Plaza Las Américas,” several people wrote, giving the location.

“There are gunmen,” wrote others, adding, “they’re not soldiers or marines, their faces are masked.”

These witness accounts have become common in Mexico over the past year, especially in violent cities where the news media have been compromised by corruption or killings. But the flurry of Twitter messages about the bodies arrived at a telling moment — on the same day that Veracruz’s State Assembly made it a crime to use Twitter and other social networks to undermine public order.

It is the first law of its kind in Mexico, but most likely not the last. At least one other state, Tabasco, is considering a similar measure, and all across Mexico, public officials are now complaining about new technologies that can help spread rumors. Panic is the fear: Two people in Veracruz were charged last month with terrorism and sabotage after their Twitter messages — spreading a false rumor that schools were under attack — seemed to cause traffic accidents as parents flooded the roads.