NEW YORK — Over more than 30 years as a criminal defense attorney, Benjamin Brafman has represented mobsters, rappers and athletes. He compared joining Michael Jackson’s defense team to playing in the Super Bowl.

One of his greatest challenges may come this week in the form of a skinny, snarky former hedge fund manager with an independent streak, Martin Shkreli.

Prosecutors have spent weeks accusing Shkreli of lying to his investors about how he was using their money, charges that could land the Brooklyn native in prison for 20 years. Already they have solicited testimony from investors who say Shkreli lied to them about the size of his hedge fund and the losses it incurred after a bad stock bet. Last week, a former Shkreli employee testified that the executive threatened to make him and his family, including four children, homeless if he didn’t do as Shkreli told him.

Now, it is Brafman’s turn. Prosecutors are preparing to rest their case Wednesday, handing the reins to the defense. Brafman said he doesn’t currently plan to call any witnesses–Shkeli won’t be testifying in his own defense–meaning that closing statements are likely to occur on Thursday.

Shkreli — who is often called “Pharma Bro” on social media — has not been an easy client. He became infamous for increasing the price of a vital drug used by AIDS patients by 5,000 percent and then publicly lamenting that he didn’t raise it more. That made it difficult to find a jury of people who didn’t already dislike him. Then the judge in his case, U.S. District Judge Kiyo Matsumoto, chastised Shkreli for speaking to reporters in the courthouse where jurors might hear him.

Hours after telling the judge that he would not testify, Shkreli took to Facebook to offer a veiled, text-y explanation. “plead the fif when it comes to the fam im like a dog i dont speak but i understand,” he wrote quoting from a Jay-Z song. (In earlier testimony, one witness revealed that Retrophin, a biopharmacy company started by Shkreli, spent $10,000 on tickets to a Jay-Z concert tickets at Carnegie Hall at a time when the company was nearly broke.)

The son of Holocaust survivors, Brafman started his career as a Manhattan assistant district attorney before starting his own law firm in 1980 and building a local reputation for defending mobsters such as Sammy “the Bull” Gravano and Vincent “the Chin” Gigante. He teamed up with Mark Geragos to defend Michael Jackson against child molestation charges, which Brafman said was like being asked ‘‘to be a quarterback in the Super Bowl.” CNN legal analyst Jeffrey Toobin once called him “the single best courtroom attorney I’ve ever seen.”

“There are lawyers that aren’t afraid to try a case, to take a case and go to trial with it,” said Maurice Sercarz, founder of the New York law firm Sercarz & Riopelle, who has tried cases together with Brafman for more than 20 years. “Ben is part of the dwindling tribe of lawyers willing to take a case to trial.”

Brafman is known for being able to appeal to a jury with his humor, including poking fun at his compact stature, about 5 feet 6 inches. During opening statements in the Shkreli trial, he quoted Lady Gaga. It is a skill he honed as a standup comic in the Catskills.

Brafman “has considerable ability to charm, to charm the jury. There is bound to be some pretty bad evidence out there but the best defense attorney may be able to get the jury to like them even if they hate the defendant,” said Roland Riopelle, a former federal prosecutor who has faced off against Brafman in court.  “In a case with a defendant who has been pillared in the press like Shkreli, his best chance may be for Ben to charm the jury. It is unlikely that  the jury will be charmed by Shkreli.”

And Brafman appears to have some favorite lines that he likes to use.

In 2001, Brafman defended entertainer Sean Combs against charges of gun possession and bribery charges related to a 1999 nightclub shooting. During opening statements, Brafman told the jury: “You can call him Sean, you can call him Mr. Combs, you can call him Puff Daddy. You can call him just plain Puffy, but the one thing you cannot do in this case is call him guilty.”

In the Shkreli trial, Brafman struck a similar note: “If you want to call him names, call him names — just don’t call him guilty. Because he’s not guilty.”

Combs was acquitted. But the Shkreli case may be an uphill battle. Prosecutors have attempted to show that Shkreli had cavalier attitude toward industry norms. In 2013, for instance, Shkreli allegedly wanted to buy shares of Retrophin, the pharmaceutical company he founded, at below the market price.

His lawyer warned him to be careful, saying in an email: “Not the best course of action— you are the director and ceo of a public company, you now have duty of loyalty and related issues.”

“f that,” Mr. Shkreli responded.

Shkreli also repeatedly told investors that the hedge fund had millions in assets when it was actually broke, according to testimony from FBI Special Agent Michael Braconi. In March 2011, for example, investors were told the assets of the hedge fund were more than $3 million when there was no money in its bank and brokerage accounts.

Under cross examination by another Shkreli attorney, Marc A. Agnifilo, Braconi was asked if his estimates included the value of biopharmaceutical company, Retrophin, which was started by Shkreli. Shkreli eventually gave disgruntled investors shares in the company, which prosecutors have called a sham.

In the end, some of these investors “made a lot of money?,” asked Agnifilio. “I think that’s fair, yeah,” said Braconi.

The defense is essentially arguing that Shkreli’s investors are not victims of a fraud because they eventually made a profit. The investors are “high rollers,” Brafman told the jury in opening statements, and used Shkreli’s “genius and made millions.”  Prosecutors say this does not make up for lying to investors.

Brafman is a “solid defense attorney,” said James Goodnow, an attorney with Fennemore Craig, a corporate defense firm. “But he has his work cut out for him here.”

Brafman has been doubted before. “The cases of Peter Gatien and Sean ‘P. Diddy’ Combs will always stand out in [my] mind, as they both involved very high-profile trials that ended in acquittals, when at the outset, the media and the entire legal community were predicting slam dunk convictions,” Brafman told LawCrossing, an industry job website.

In 1998, Gatien, a nightclub owner, was acquitted by a federal jury of charges that he turned his two Manhattan clubs into virtual drug supermarkets. After Combs, Brafman wept at the defense table.

“Both men also became friends who I still see from time to time and each of them credits me with ‘saving’ their lives. Pretty good feeling,” he said.