Poland’s deputy minister of justice has resigned and a senior official from his department was dismissed after evidence emerged of a campaign of alleged harassment, intimidation and blackmail coordinated from within the justice ministry against judges resisting government efforts to take control of the Polish judiciary.

Łukasz Piebiak, who served as deputy of minister of justice with responsibility for the judiciary, resigned on Tuesday after Onet, a news portal, published alleged communications via WhatsApp and Facebook Messenger with a woman identified in the Polish press only as “Emilia”.

In one of the alleged exchanges, Emilia outlines a plan to discredit Krystian Markiewicz, a judge and law professor who serves as the head of Iustitia, an association of Polish judges that has been fiercely critical of attempts by the ruling rightwing Law and Justice party (PiS) to assert direct control over the appointment, promotion and discipline of all the country’s judges.

The plan consisted of circulating a lurid four-page dossier of unsubstantiated allegations about Markiewicz’s private life. Responding to Emilia’s suggestion, Piebiak is alleged to have written: “I think it will help. It is important that it sweeps through Iustitia to let them know who we are dealing with. People will spread it, and Markiewicz will fade away, knowing what we have on him.”

Emilia’s social media history reveals a history of abuse directed against judges who have criticised the PiS over its efforts to take control of the judiciary.

The dossier, which included unsubstantiated claims about Markiewicz’s private life, was distributed to more than 2,000 people associated with Iustitia. According to the Onet report, Piebiak also gave Markiewicz’s private address to Emilia, who sent a copy of the dossier to the judge’s family home.

In another alleged exchange, Piebiak and Emilia discuss a plan to share with state media details of an alleged extra-marital affair involving a judge from the Warsaw branch of Iustitia. The allegations were broadcast on state television in May last year, after which Emilia wrote to Piebiak asking whether he approved of the result. Piebiak is alleged to have replied: “Great, I am just sending it to the boss, to make him happy.”

Piebiak’s reference to “the boss” has raised questions as to whether Zbigniew Ziobro, Poland’s justice minister, was aware of Piebiak’s activities.

Piebiak, a regional judge, played a leading role in the PiS campaign to assume control of the judiciary, through the passage of legislation giving Ziobro the power to dismiss court presidents, and the appointment to key positions of pro-government judges with close professional and personal links to the justice ministry.

“He was an insider. As a judge he knows our weakness, our vulnerabilities. He knew where to find unhappy people,” said Jaroslaw Gwizdak, a former court president in the south-western region of Silesia who opted to leave the profession rather than serve as a judge under the new regime.

“They find judges with disciplinary problems, judges whose careers are going nowhere, people with no integrity, and offer them the chance to leapfrog everybody else, by giving them jobs in the ministry and by appointing them to the country’s top courts,” Gwizdak added.

Polish judges who have resisted the government have long complained of a campaign of intimidation that they allege is closely coordinated between the justice ministry, state prosecutors, government-controlled media and anonymous social media accounts.

“They’re trying to break me and they are winning. I’m tired, I want to live in peace. They have the power of the whole state behind them and I’m alone,” Wojciech Łączewski, a district court judge in Warsaw, told the Guardian last year.

Emilia, the woman at the centre of the scandal, is understood to be the former wife of a pro-government judge with close ties to the justice ministry.

In an emotional statement published on Wednesday by the liberal broadsheet Gazeta Wyborcza, she described herself as having been “cheated and exploited”, claiming that a group of judges and officials within the ministry had passed her the compromising information and encouraged her to believe that she was doing her patriotic duty in helping to rid the country of what government propaganda routinely denounces as a “privileged caste” of “thieves in robes”.

“All that hate,” she wrote, “I did it for Poland.”