Graham Ivan Clark, 18, pleaded guilty to fraud charges for a hack of several Twitter accounts last summer.

Graham Ivan Clark, 17, of Tampa, was arrested on 30 charges. Authorities say he was the "mastermind" of a July 15 Twitter hack scheme which gave him and two others access to the high-profile accounts of Bill Gates, Barack Obama and many other celebrities with millions of followers. At left is a message sent when Apple's Twitter account was hacked.

[ Hillsborough County Sheriff’s Office | Twitter ]

TAMPA — The Tampa teen who took control of well-known Twitter accounts last summer and used them to solicit more than $100,000 in Bitcoin pleaded guilty to state charges Tuesday in exchange for a three-year prison sentence.

In a deal with prosecutors, Graham Ivan Clark agreed to serve three years in prison, followed by three years probation.

Clark was 17 when he was accused of masterminding a brazen social media hack that targeted some of the world’s most famous names, among them: President Joe Biden, former President Barack Obama, Elon Musk, Kanye West, Bill Gates, Jeff Bezos, Mike Bloomberg, Warren Buffet, Floyd Mayweather, Kim Kardashian, Apple, Uber and other companies.

The agreement allowed Clark, now 18, to be sentenced as a “youthful offender,” avoiding a minimum 10-year sentence that would have followed if he’d been convicted as an adult. The mandatory minimum will only apply if Clark violates his probation.

He will serve time in a state prison designated for young adults. He may be eligible to serve some of his time in a military-style boot camp.

“Graham Clark needs to be held accountable for that crime, and other potential scammers out there need to see the consequences,” Hillsborough State Attorney Andrew Warren said in a statement. “In this case, we’ve been able to deliver those consequences while recognizing that our goal with any child, whenever possible, is to have them learn their lesson without destroying their future.”

Clark appeared in a virtual court hearing Tuesday afternoon from the Hillsborough County jail, where he has been confined since his arrest. He wore a red uniform and medical mask, and sported a crew cut.

His voice was a monotone as he answered a series of standard questions from Judge Christine Marlewski, acknowledging that he understood his guilty plea and that he was giving up his right to a trial. He said little else.

Provisions of the plea agreement require that Clark will be barred from using computers without permission and supervision from law enforcement. He will have to submit to searches of his property and give up the passwords to any accounts he controls.

His defense attorney, David Weisbrod, confirmed that Clark had turned over all the cryptocurrency he had acquired.

Twitter users were flummoxed July 15 when accounts belonging to several celebrities, political figures and well-known corporations began tweeting strange messages.

“I am giving back to the community,” tweeted the account belonging to President Joe Biden. “All Bitcoin sent to the address below will be sent back doubled! If you send $1,000, I will send back $2,000. Only doing this for 30 minutes … Enjoy!”

Similar messages came from other famous Twitter accounts.

Authorities said the scam netted about $117,000 in Bitcoin before it was shut down.

Clark, a student at Gaither High School, was arrested days later at his home in the Northdale area of Hillsborough County.

RELATED: Tampa teen pleads not guilty as documents reveal how feds cracked his Twitter hack case

The Florida Department of Law Enforcement found that he accessed Twitter’s systems by convincing an employee he worked in the company’s information technology department. He then managed to access the company’s customer service portal.

Clark used the phony tweets to direct people to send bitcoin to accounts he owned, prosecutors said. Bitcoin is a cryptocurrency that is difficult to track.

Two others, Nima Fazeli of Orlando and Mason Sheppard of the United Kingdom, were also charged with federal crimes related to the scheme.

Prosecutors charged Clark in state court, they said, because state law allowed greater flexibility to try a minor as an adult in a financial fraud case.