Martin Shkreli, who gained national notoriety two years ago for jacking up the price of a drug used by AIDS patients, was convicted of securities fraud Friday for mismanaging two investment funds.

A jury in Brooklyn deliberated almost five days before returning guilty verdicts against Shkreli, 34, on two counts of securities fraud and a single count of conspiracy. He was acquitted on five other counts of conspiracy.

The most serious count, securities fraud, carries a maximum prison term of 20 years.

When the first guilty verdict was delivered, Shkreli looked to his right with a surprised smirk. Outside, he called his prosecution "a witch hunt of epic proportions," and he focused on the acquittals. "Maybe they found one or two broomsticks," he said.

Barely an hour after the verdict, he was livestreaming on YouTube from his apartment, holding a beer and predicting that the sentence would be "close to nil." He said that if he does go to prison, it will probably be a "Club Fed" where he will "play basketball and tennis and Xbox" for a couple of months.

Shkreli's lawyer, Benjamin Brafman, raised the prospect of an appeal and said the verdict would give the court "enormous discretion" on sentencing. No sentencing date was set.

Federal prosecutors accused Shkreli of cheating investors out of more than $11 million between 2009 and 2014 in what amounted to a Ponzi scheme.

They said he mismanaged money at the investment funds Elea Capital, MSMB Capital and MSMB Healthcare, as well as while he was CEO of Retrophin (RTRX), a pharmaceutical company he founded in 2011.

Prosecutors argued that he lied to investors at MSMB Capital and MSMB Healthcare about how well the funds were doing, and that he used money from Retrophin as a piggy bank to pay off MSMB investors, and to cover personal loans and other debts.

"Shkreli misled investors in his self-indulgent scheme," FBI Assistant Director-in-Charge William Sweeney said in a statement after the verdict. "Today's conviction shows that those who corrupt the market will ultimately be brought to justice."

Brafman framed his client as an oddball genius who ultimately made his investors richer. He said that Shkreli never intended to defraud anyone, and called him an "honest kid."

Shkreli drew national scorn two years ago when, as the CEO of Turing Pharmaceuticals, he unapologetically raised the price of a lifesaving drug used by some AIDS patients from $13.50 per pill to $750. That episode is unrelated to the fraud case.

The Daily Beast named him the "most hated man in America." He defended the price hike, claiming that his company needed to profit from the drug. He also said that everyone who needs it would be able to afford the drug, Daraprim.

After his indictment, Shkreli used Twitter and Periscope to livestream himself playing video games in his pajamas and chronicle trips around New York to about 200,000 followers.

In January of this year, he was kicked off Twitter and Periscope after making unwanted advances toward a magazine editor. He kept up his use of social media throughout the trial, posting videos on Facebook despite efforts by prosecutors and his own lawyer to keep him quiet.

"My case is a silly witch hunt perpetrated by self-serving prosecutors," he said on Facebook at one point. "Thankfully my amazing attorney sent them back to junior varsity where they belong. Drain the swamp. Drain the sewer that is the DOJ. MAGA."