A teenager accused of "masterminding" the hijacking of Barack Obama and Bill Gates' Twitter accounts last summer has been sentenced to three years' prison and another three years' probation.

Graham Ivan Clark, now 18, pleaded guilty to 30 counts of communications fraud and other state crimes for hacking the social media application for a cryptocurrency scam, Florida prosecutors said.

His youth offender status spared him from a mandatory 10-year minimum sentence, Fox News reported Thursday. If he violates his probation, prosecutors said he would be resentenced as an adult.

Clark used the accounts to post fraudulent Twitter messages and solicit more than $100,000 in Bitcoin. Tweets from Tesla chief executive Elon Musk's account said he would double any Bitcoin payments sent to a specific Bitcoin address. Clark scammed around $117,000 in Bitcoin.

According to prosecutors, Clark and his fellow conspirators hacked into several Twitter accounts - including politicians like Michael Bloomberg and celebrities like Kim Kardashian and Kanye West.

His fellow conspirators - Nima Fazeli of Florida and Mason Sheppard of the UK - have been separately charged and their cases remain open.

Twitter called the hack a "coordinated social engineering attack."

"The hackers targeted a small number of employees through a phone spear phishing attack...to gain access to both our internal network as well as specific employee credentials that granted them access to our internal support tools," Twitter said.

The cyberattack led to questions about Twitter's security and was investigated by the Federal Bureau of Investigation. "We'll continue to organize companywide phishing exercises throughout the year," Twitter said in a statement at the time.