A frustrated US District Judge Kiyo Matsumoto on Wednesday scolded Martin Shkreli for indiscreetly commenting on his ongoing securities and wire fraud trial and potentially jeopardizing the trial—which is just in its second week and already a media spectacle. Matsumoto told the defendant to keep quiet about the trial while he is in or around public areas of the courthouse, despite Shkreli's lawyer’s appeal that his client is simply stressed and emotional.

Matsumoto's move comes after the prosecution complained in court filings (PDF) and in verbal arguments this week that Shkreli was secretly tweeting about the trial and making inappropriate comments. Although Shkreli was banned from Twitter earlier this year after harassing a journalist , the prosecution notes that he appeared to be tweeting using the account @BLMBro. In a June YouTube video, Shkreli clearly says that the handle belongs to him ( video here, 6:13-6:16 ). And using that handle, Shkreli questioned the credibility of witnesses and evidence. He also claimed that media reports about the trial were untrue. The @BLMBro account has since been suspended.

The prosecution also pointed to a trial lunch break last week, during which Shkreli strolled into a courthouse viewing room that was packed with reporters. There, he loudly criticized evidence and witnesses and called the prosecution “junior varsity.” Shkreli only left the room after his lawyer came to retrieve him.

In court today, The Washington Post reported that Matsumoto said she was shocked by all of this, noting that Shkreli’s comments could have easily been overheard by jurors.

The prosecution suggested that this may be exactly what Shkreli aimed to do. In court filings, they said Shkreli’s strategy may be to create a media circus that taints the jury. They also noted the difficulty of selecting the jury in the first place , screening 250 potential jurors to find 18 who were available for the duty and held no biases against the infamous ex-pharmaceutical CEO.

In Shkreli’s defense, lead lawyer Benjamin Brafman wrote in filings (PDF) that Shkreli’s behavior was not a legal strategy; rather this was an emotional defense mechanism to cope with the stress of the trial and his unfair treatment by the media. He described Shkreli as being in a “frail emotional state” and accused journalists of trying to “bait” Shkreli into making public statements. Brafman went on to argue that although he himself had advised Shkreli to keep quiet, he strongly objected to a gag order because he and Shkreli “must be permitted to carefully confront” biased press coverage.

Still, in court Wednesday, CNBC reported that the prosecution suggested that it was Shkreli’s comments—not media reports—that were the source of falsehoods. They noted that last week Shkreli told reporters that he never considered a plea deal prior to trial. Yet prosecutors revealed for the first time that Brafman had indeed reached out to them to discuss the potential for a guilty plea deal several times prior to the trial.

In court, Brafman said that he was ethically bound to pursue the potential of a plea deal but that Shkreli was always resolute about going to trial.

Shkreli faces eight counts of fraud related to an alleged Ponzi-like scheme to defraud investors of two hedge-funds he managed as well as his former pharmaceutical company, Retrophin. Yet, Shkreli is better known for dramatically raising the price of an anti-parasitic drug often given to babies and people suffering from HIV/AIDS.