The young hacker, accused of being the mastermind behind a high-profile Twitter account violation last year, pleaded guilty in a Florida court on Tuesday and agreed to serve three years in juvenile prison.

Eighteen-year-old Graham Ivan Clark was charged with fraud after the Twitter accounts of Elon Musk, Jeff Bezos and former President Barack Obama were compromised. Under the control of Mr. Clark, the accounts tweeted fraudulent messages requesting Bitcoin and promising to double the money of everyone who sent cryptocurrency.

“Bitcoin currency was not returned as promised to these victims,” ​​said Darrel Dirks, prosecutor with the Florida prosecutor’s office. The program brought in more than $ 100,000 worth of Bitcoin before it closed.

The attack took control of Twitter’s internal systems used to manage accounts and resulted in a mass shutdown of verified Twitter accounts as the company attempted to evict the hackers from its systems.

The breach raised questions about Twitter’s corporate security and sparked speculation that government-sponsored hackers, not teenagers, might be responsible.

Recognition…Hillsborough County Sheriff’s Office via Reuters

Mr. Clark grew up in Tampa and found ways to outsmart players on the Minecraft video game as a child, people who knew him at the time told the New York Times. He sold and traded rare social media usernames on the OGUsers forum, where he connected with fellow hackers who said they participated in the Twitter breach. Two other young men, Nima Fazeli and Mason Sheppard, were also arrested and charged with the hack.

During the plea, Mr. Clark agreed to three years of juvenile prison followed by three years of probation. He also agreed not to use computers without permission or supervision from law enforcement agencies. If he violates the terms of the treaty, he faces 10 years in adult prison.

Since Mr. Clark is classified as a juvenile offender, he may be able to serve part of his sentence in a boot camp. Prosecutors said he had handed over the cryptocurrency he owned at the time of his arrest, and it will be used to pay compensation to the victims of the hack. He is credited with 229 days of time since his arrest last year.

“He took over famous people’s accounts, but the money he stole came from ordinary, hard-working people. Graham Clark must be held accountable for this crime and other potential fraudsters must see the consequences, “Hillsborough District Attorney Andrew Warren said in a statement. “In this case, we were able to draw these conclusions while also realizing that our goal with every child, whenever possible, is that they learn their lesson without ruining their future.”

David Weisbrod, an attorney for Mr. Clark, declined to comment on the plea.