NEW YORK (AP) - Twitter says it will require U.S. political advertisers to identify themselves and certify that they are in the U.S. by verifying a mailing address.

The company says the new rules announced Thursday will apply to any advertising that seeks to influence the outcome of an election.  Google and Facebook previously announced similar verification requirements.

The move comes as social media companies prepare for the U.S. midterm elections. They are eager to avoid the mess they found themselves in during the 2016 elections. They have been accused of not doing enough to prevent foreign meddling using their services.

Twitter's announcement comes a day after the company said it will label the tweets and accounts of U.S. political candidates as such.

Also on Thursday, Facebook announced guidelines around political "issue" ads that don't support a candidate but address polarized issues such as gun control and abortion rights.

Twitter hasn't done this yet. Facebook said that when users click on the label on such an ad, they will be taken to a page with more information, including who paid for it and how many people saw it.