The 18 and 19-year-old are accused of posting messages and sending out fake tweets.
Two Scottish teenagers have been arrested over claims they hacked into the Metropolitan Police's website and posted a series of bizarre messages.
The country's largest police force was hit by a cyber attack in July and a series of tweets were sent from its verified account, which has more than 1.2 million followers.
A stream of unusual emails were also sent from the force's press bureau.
The arrested teenagers are aged 18 and 19 and from Lossiemouth and Glasgow.
They have been charged with carrying out the alleged hack by Police Scotland.
President Donald Trump used the incident to attack London Mayor Sadiq Khan.
Quoting a tweet from right-wing commentator Katie Hopkins, which said officers had "lost control of London streets" and "lost control of their Twitter account too", Trump wrote: "With the incompetent Mayor of London, you will never have safe streets."
Scotland Yard previously confirmed its website had "been subject to unauthorised access".
The force said it used an online provider called MyNewsDesk to issue news releases and said "unauthorised messages" appeared on its website, Twitter account and in emails sent to subscribers.
The tweets, which have been deleted, contained offensive language and mentioned the names of several people.
One of them called for the release of drill rap artist Digga D - real name Rhys Herbert - who was jailed last year for being part of a gang with machetes.
The posts also included messages such as "no comment get my lawyer" and "what you gonna do phone the police?".
A Police Scotland spokesman said: "Two men, aged 18 and 19, from the Lossiemouth and Glasgow areas respectively, have been arrested and charged in connection with unauthorised access and publication of content on the Metropolitan Police Service's news platform on Friday 19 July 2019.