Notorious "pharma bro" Martin Shkreli made a sob-filled plea for leniency but ended up getting sentenced Friday to seven years in prison for federal fraud charges related to hedge funds and a drug company that he once ran. "The one person to blame for me being here today is me," a choked-up Shkreli told a judge before she imposed the prison term in Brooklyn, New York, federal court. "Not the government. There is no conspiracy to take down Martin Shkreli." "I took down Martin Shkreli with my disgraceful and shameful actions." "This is my fault. I am no victim here," Shkreli said, before breaking down into tears as he promised not to let his lawyer Benjamin Brafman down in his efforts to contribute to society. "Do not feel bad for me," Shkreli told a packed courtroom that included supporters and family members, many of whom had written letters asking Judge Kiyo Matsumoto to spare him from a harsh sentence. And he had a message for the investors he duped: "I am terribly sorry I lost your trust. ... You deserve far better." "I was never motivated by money," Shkreli said. "I wanted to grow my stature and my reputation." "I am here because of my gross, stupid and negligent mistakes I made."

A courtroom sketch shows Martin Shkreli crying in court during his sentencing with his defense lawyer Ben Brafman on March 9, 2018. Elizabeth Williams | CNBC

The seven-year sentence — to which Shkreli listened impassively — was significantly higher than the 18-month maximum requested by defense lawyers. "He has the potential to do good," Brafman argued, citing Shkreli's intellectual brilliance and altruism toward others less fortunate than himself. "He shouldn't be sentenced simply for being Martin Shkreli." While Brafman did not get what he wanted, the sentence was also less than half the minimum 15-year term that prosecutors said they wanted Friday from Matsumoto. "We do believe the public needs to be protected from Mr. Shkreli," assistant U.S. Attorney Jacquelyn Kasulis told Matsumoto while arguing for that stiff term. "We do believe, your honor, that he is dangerous," Kasulis said. Matsumoto said she had struggled over what to give Shkreli as a sentence. In a lengthy lead-up to announcing her decision, the judge noted Shkreli's upbringing in a household that included an abusive father, his problems with panic attacks, his charitable contributions to individuals and groups, and his talent for picking stocks and for scientific research. But Matsumoto also detailed Shkreli's years-long series of sophisticated financial deceptions, his foul-mouthed boasts of having threatened to render a former employee and his family "homeless," and his emailed statements from prison saying he would do anything necessary to win a light prison term. She urged Shkreli to continue teaching inmates math, finance and other subjects, as he has in recent months. "I do wish you well, Mr. Shkreli," Matsumoto said. "Thank you very much, your honor," he responded. Shkreli, who will get credit for six months he has already spent in jail since shortly after his conviction, also was sentenced to three years of probation after his release and ordered to pay a $75,000 fine. There is no parole in the federal prison system, but Shkreli could be released after having served almost six years, due to credit for good conduct. The judge had already ordered Shkreli, who will turn 35 on March 17, to forfeit nearly $7.4 million to the federal government. And she ordered him to obtain mental health counseling while on probation. A psychological examination of Shkreli performed before his sentencing found that he suffered from generalized anxiety disorder, major depressive disorder and an unspecified personality disorder. Shkreli also had revealed that he was drinking seven to eight alcoholic beverages per day after he was indicted in the case in late 2015 to deal with his anxiety. He called that "toxic behavior," the judge noted. After his release into probation, Shkreli will be barred from holding a majority stake in a company, as well as an executive position or directorship of a company.

A courtroom sketch shows Martin Shkreli making a statement and weeping during his sentencing, while his defense lawyer Ben Brafman holds his head in his hands. Elizabeth Williams | CNBC

"I think it's hard to claim victory when someone like Martin Shkreli is going to jail, but if you are asking me, if it could have been a lot worse, absolutely," Brafman said outside of court. "The government didn't get what they wanted. We didn't get what we wanted, either," Brafman said. "This is a good judge who I think spent a great deal of time trying to examine the facts and all of the letters that were written on behalf of Mr. Shkreli and she made her decision and we all have to live with it." He also said, "Martin is fine." The three-hour sentencing hearing came 2½ years after Shkreli attracted widespread negative media attention for his decision to hike the price of a drug by 5,500 percent at Turing Pharmaceuticals, another company he founded. But Shkreli's sentencing was not connected to that pricing of the anti-parasite medication Daraprim. It also wasn't related to his social media trolling of adversaries, who have included Hillary Clinton, members of the hip-hop group Wu-Tang Clan and journalists. "I want to reiterate something that I've said since the beginning — this trial is not about his public persona, nor about his actions or statements about pricing of pharmaceuticals," Matsumoto said. "I will base my sentence on the conduct he was found guilty of."

A file photo of former pharmaceutical executive Martin Shkreli. Getty Images

He was found guilty of misleading investors about key details and the dismal financial market performance of the MSMB Capital and MSMB Healthcare hedge funds that he operated. Shkreli also was convicted last August of conspiring to fraudulently manipulate stock shares of Retrophin, the pharma company he created after both hedge funds effectively collapsed. Evidence at trial revealed that Shkreli had used stock and cash from publicly traded Retrophin to pay back the duped hedge-fund investors, who all ended up getting more than they had originally invested. Witnesses at that trial also painted a picture of Shkreli as a complicated person who could inspire grand visions of lifesaving pharmaceutical treatments while also frustrating people with his habit of playing fast and loose with the facts. A number of those witnesses testified to Shkreli's brilliance, or even genius, as well as to his tendency toward depression and self-sabotage. Defense lawyers had asked Matsumoto in a court filing last week to give Shkreli a relatively light prison term of 12 to 18 months, followed by 2,000 hours of community service and mandatory therapy. They called Shkreli a "very unique defendant" who "is a kind, caring and generous person who uses his time and effort to help those in need." "If not warehoused in prison, Martin could literally save lives," Shkreli's lawyers wrote in their sentencing recommendation. But prosecutors had asked for at least 15 years in prison. They argued that Shkreli lacked "genuine remorse" for his crimes and had a pattern of deceptive schemes spanning even after the crimes for which he was convicted. They called Shkreli "a man who believes the ends always justifies the means." Federal sentencing guidelines had suggested a prison term of decades, in large part because of Matsumoto's finding that the losses from Shkreli's crimes totaled $10.4 million.

The judge refused to give him credit for the fact that his hedge-fund investors all ended up with more than they originally placed with him, noting that Shkreli only began his scheme to repay them with Retrophin's assets after investors began raising red flags that they had been defrauded. In addition to his prison term, Shkreli already had been ordered by the judge to secure the forfeiture award to give up his ownership of a $5 million stock account that had been used as collateral for a now-revoked release bond. She also told him to give up his ownership of a one-of-a-kind Wu-Tang Clan album that he bought for $2 million, a Picasso painting, a Lil Wayne album, and his stake in Vyera Pharmaceuticals, which previously was known as Turing. Shkreli has been locked up in a federal jail in Brooklyn since September, a month after his conviction, when Matsumoto revoked his $5 million release bond. Matsumoto's move came after Shkreli, in yet another social media stunt, offered his Facebook followers a $5,000 bounty for samples of Clinton's hair. The offer, which Shkreli claimed was satire, drew the attention of the Secret Service, which provides protection for Clinton, and drew the ire of prosecutors. Matsumoto said Shkreli represented a danger because of his bounty offer. In a letter sent to the judge in advance of his sentencing asking for a light prison term, Shkreli wrote, "I was a fool," and called himself "far from blameless." "I accept the fact that I made serious mistakes, but I still believe that I am a good person with much potential," Shkreli wrote from jail. "The trial and the six months in a maximum security prison has been a frightening wake-up call," Shkreli wrote. "I understand how I need to change." Shkreli plans to appeal his conviction. — Additional reporting by Ashley Turner. See how Martin Shkreli, the "pharma bro," got to today's sentencing TONIGHT on American Greed at 10 p.m. ET.

WATCH: Co-worker says Shkreli 'mentally unstable'