SHANGHAI — Three days before the most sensitive political anniversary on the Chinese calendar, Twitter suspended the accounts of Chinese political commentators in what it said was an accident. The move showed starkly the global political ramifications of Silicon Valley slip-ups.

Twitter’s action, which one human rights worker said affected more than 100 users, came over several hours late Friday and early Saturday. It hit human rights lawyers, activists, college students and nationalists, who use workarounds to get access to Twitter, which is banned in China. Just about every part of the raucous, if small, Chinese-language Twitter world was affected.

The accounts began rapidly disappearing just days before the 30th anniversary of the crackdown on a student-led pro-democracy demonstration in Tiananmen Square in Beijing. Many online assumed the worst: a coordinated attack by Beijing to project its suffocating internet censorship outside its own digital borders. Senator Marco Rubio, a Florida Republican, tweeted about his concern.

Yet the culprit was not Chinese censors but Twitter’s own overactive filters.

In a statement, Twitter said that as a part of its routine efforts to stop spam and inauthentic behavior, it had inadvertently gone after a number of legitimate Chinese-language accounts.