A judge in Peru has sent the country’s divisive opposition leader Keiko Fujimori back to jail, ordering she should serve three years as a preventative measure while prosecutors investigate claims she ran a “de facto criminal organisation” within her political party to launder campaign donations.

Judge Richard Concepcíon Carhuancho ruled Fujimori, 43, who was put in police custody for a week this month, should return to jail to keep her from fleeing before a trial for allegedly running a money laundering racket within her party, Fuerza Popular.

Fujimori, the daughter of the former president Alberto Fujimori and a two-time loser in the last presidential elections, has denied taking $1.2m from Odebrecht, the Brazilian construction firm at the centre of Latin America’s biggest graft scandal, during her 2011 election campaign.

Her lawyers say she is a victim of “political persecution” and have vowed to appeal.

It is a dramatic reversal of fortunes for Keiko Fujimori, who a few months ago was Peru’s most powerful politician with a congressional majority and an appetite to avenge her razor-thin 2016 electoral defeat to Pedro Pablo Kuczynski who resigned in March amid corruption allegations.

But a series of leaks and journalistic investigations have chipped away at her credibility, revealing links with the cuellos blancos, a group of corrupt judges and prosecutors led by supreme court judge César Hinostroza, who fled to Spain last month.

The latest leak revealed an online chat between the party’s inner circle and lawmakers. Exchanges included insults directed at the president, Martín Vizcarra, and plots to intimidate José Domingo Pérez, the prosecutor investigating Fujimori.

Domingo Pérez used the conversations in the chat – known as La Botica, a kind of local chemist – as evidence that Fujimori’s party was shielding the corruption-tainted attorney general, Pedro Chávarry, who was at the centre of graft scandal in Peru’s judiciary.

In a ruling lasting more than eight hours, Judge Concepción said: “We want to make clear that [this office] has noticed the attempts to destroy the investigating prosecutor and the shielding of the attorney general Pedro Chávarry.

“We see a suspected criminal organisation which began to interfere with the justice system.”

Beyond the criminal implications that placed Fujimori at the focus of public demonstrations about corruption, the chat also invited widespread ridicule for her domineering style, such as ordering the party’s lawmakers to give only “protocolary applause” to Vizcarra’s national day speech.

Many Peruvians are surprised by the latest twist in a political career that began when Fujimori was 18 and became her father’s first lady. Peruvian political life has been held captive by the Fujimori dynasty for decades. In October, Peru’s supreme court revoked a medical pardon granted to Fujimori’s 80-year-old father by Vizcarra’s predecessor.

But four former presidents have been either charged or put under investigation for corruption, mostly linked to Odebrecht, and Vizcarra has promised to transform anti-graft pledges from “theory into practice”. A referendum on strengthening anti-corruption laws in expected to be held next month.