STORY: "They are showing very suggestive images," prosecutor Samuel Rojas said as the footage of the male stripper, Ricardo Milos, appeared on screens during the hearing.
The unexpected content appeared as Rojas was outlining the reasons why Castillo should be investigated. The hearing was being publicly broadcast on the judiciary branch's television channel, with the offending clip later shared widely on Twitter.
A supreme court judge is evaluating a request to throw out the investigation into whether the president led a corruption plot involving his former Minister of Transport and Communications, Juan Silva, who is currently in hiding.
The president's legal defense team is trying to prevent prosecutors from questioning him at a hearing scheduled for Friday.
The video of Milos appeared through the user account of Benji Espinosa, a member of Castillo's defense team, prompting a brief suspension of the hearing.
Espinosa denied that he was responsible for the video and says he was the victim of "computer crime."
"The video appeared abruptly, giving the impression that it came from my account, which I reject," Espinosa told Reuters by phone.
The lawyer added he was filing a complaint with the judge and claimed that the incident "shows that the virtual system of the judiciary is vulnerable."
Leftist President Castillo currently faces scrutiny of alleged corruption in his government, social protests and a fall in popularity after 10 months in power.