Martin Shkreli was sentenced to seven years in prison on Friday for defrauding investors out of more than $10 million.

Shkreli, who gained notoriety for inflating the price of a life-saving drug, had faced up to 45 years behind bars for mismanaging money at his hedge funds, according to the judge. He'll get six months credit for time served in a Brooklyn federal jail.

He was convicted on August 5, 2017 of securities fraud and conspiracy in what prosecutors said amounted to a Ponzi scheme. Shkreli called the charges "a witch hunt of epic proportions."

During his sentencing on Friday in Brooklyn federal court, Shkreli, 34, broke into tears and pleaded with the judge for leniency as she passed him a box of tissues.

Related: Martin Shkreli must forfeit $7.4 million, including infamous Wu Tang album

"I look back and I'm embarrassed and ashamed," he told the court. "I am terribly sorry," he said to his investors, "I lost your trust."

"There's no conspiracy to take down Martin Shkreli. I took down Martin Shkreli with my disgraceful and shameful actions."

He described the time he's spent in jail as a"heartbreaking experience."

At his trial last year, Shkreli often wore a smirk and was chastised by the judge for his behavior, including for an incident in which he told reporters that the prosecutors on the case were "junior varsity." He also ignored the advice of his lawyer by commenting on the trial via social media and YouTube.

Shkreli's lawyer Ben Brafman, told reporters on Friday he thought the prison sentence was too severe.

"I'm disappointed that the sentence wasn't less than seven years. But Martin's fine and he will be fine," he said.

Prior to the sentencing, Brafman defended his client as an eccentric and generous genius who's been teaching math to his fellow prisoners and who bought diapers for the girlfriend of a prisoner who just had babies. Brafman said that sometimes he wanted to give him a hug, but admitted that he could also be so aggravating "there are times when I want to punch him in the face."

Prosecutors painted a less flattering picture. "He doesn't think that he did anything wrong because he thinks he's different," said prosecutor Jacquelyn Kasulis during the sentencing. "He thinks he's better than everybody else and the rules don't apply to him."

Prosecutors said that between 2009 and 2014, Shkreli lied to investors at MSMB Capital and MSMB Healthcare about how well the funds were doing, and that while he was CEO of Retrophin, (RTRX) he used the pharmaceutical company as a piggy bank to pay off MSMB investors and to cover personal loans and other debts.

After his conviction, he was released on $5 million bail.

Martin Shkreli headed to jail after Hillary Clinton threats

In September, Judge Kiyo Matsumoto revoked his bail after Shkreli took to social media to offer $5,000 to anyone would bring him a strand of Hillary Clinton's hair.

Earlier this week, Matsumoto ordered Shkreli to forfeit about $7.4 million in assets, which may include a one-of-a-kind Wu Tang Clan album. He was also ordered to hand over a Picasso, and an album called "Tha Carter V" by Lil Wayne. At the sentencing, the judge also fined him $75,000. His net worth is still about $20 million, after subtracting the forfeiture and the fine, and also the taxes and legal fees he owes.

Martin Shkreli convicted of securities fraud, conspiracy

His fraud conviction had nothing to do with the controversy that made him famous. While he was chief executive officer of Turing Pharmaceuticals in 2015, he jacked up the price of the life-saving drug Daraprim, a treatment for HIV patients, from $13.50 a pill to $750.

The price hike sparked a public backlash that landed him on Capitol Hill, testifying about drug prices. He sneered through the proceeding and pleaded the Fifth Amendment.

The Federal Bureau of Prisons will decide at which federal prison Shkreli will serve his sentence.

Correction: An earlier version of this article incorrectly reported that the judge had ordered that Shkreli must turn over the Wu-Tang Clan album.