Twitter bots may have altered the outcome of two of the world’s most consequential elections in recent years, according to an economic study.

Automated tweeting played a small but potentially decisive role in the 2016 Brexit vote and Donald Trump’s presidential victory, the National Bureau of Economic Research working paper showed this month. Their rough calculations suggest bots added 1.76 percentage point to the pro-“leave” vote share as Britain weighed whether to remain in the European Union, and may explain 3.23 percentage points of the actual vote for Trump in the U.S. presidential race.

“Our results suggest that, given narrow margins of victories in each vote, bots’ effect was likely marginal but possibly large enough to affect the outcomes,” according to authors Yuriy Gorodnichenko from the University of California at Berkeley and Tho Pham and Oleksandr Talavera from Swansea University in the U.K.

The research comes as members of the U.S. intelligence community allege that Russian hackers tried to sway the 2016 presidential election in Trump’s favor in part by deploying Twitter bots, which are programs that control a Twitter account. The president frequently denies that he or members of his team colluded with the hackers, and says he won because he ran a smarter campaign than his Democratic rival.

Spread Quickly

According to the study, bots tended to influence people most when their message backed up their prior opinion. For instance, Trump supporters tended to react to messages spread by pro-Trump bots. And information reverberated quickly: it was generally disseminated and absorbed among Twitter users in 50 to 70 minutes.

The researchers collected data for the study using the Twitter streaming application programming interface, a tool that allows users to collect a random sample of real-time tweets with specified characteristics. The authors identified bots by their unusually large number of tweets, whether they tweeted the middle of the night, and whether they re-posted identical messages, among other criteria.

To figure out how tweeting influenced votes, the study authors looked at the share of pro-leave or pro-Trump tweets by geography to check how closely votes were correlated with Twitter activity. They then figured out how much the accounts they defined as bots added to the volume of tweets advocating Brexit or Trump, and extrapolated from there.

“These two campaigns and subsequent debates about the role of bots in shaping the campaigns raise a number of questions about whether policymakers should consider mechanisms to prevent abuse of bots in the future,” they wrote.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.