Facebook, Twitter and Google routinely squabble for users, engineers and advertising money.

But when it comes to security threats and elections meddling, it makes sense for these tech giants to work together.

Such cooperation was evident Tuesday when Facebook announced that it had removed about 650 suspicious pages, groups and accounts linked to Russia and Iran. This was followed by similar news from Twitter. On Monday, meanwhile, Microsoft reported a new Russian effort to impersonate conservative U.S. websites, potentially as part of an espionage campaign.

Cooperation makes it easier for tech companies to fight the bad guys. It also makes them look good in the eyes of their users and regulators by showing that they take the threats seriously enough to set aside competitive differences.