Twitter Inc. has suspended accounts linked to Iran-backed militant group Hezbollah and Palestinian group Hamas after U.S. lawmakers criticized the social-media company for allowing those entities to remain active on the platform even though the State Department has designated both as terrorist organizations.

Twitter, on its messaging platform, shows that accounts including Hamas’s English and Arabic language accounts had been suspended for violating its rules. “There is no place on Twitter for illegal terrorist organizations...