Opponents of President Nicolas Maduro who have taken to the streets day after day in Venezuela now find themselves rallying in support of an unexpected hero: the chief prosecutor who helped throw many of them into jail.

Until recently, Luisa Ortega was seen as a hardline loyalist of the socialist administration, responsible for dozens of arrests on trumped-up charges against anti-government protesters. But now she is being lionized by the opposition and disaffected supporters of the late Hugo Chavez alike for her decision to break with Maduro, the hand-picked successor to "El Comandante."

Roberto Marrero, a lawyer for the nation's most-emblematic political prisoner, Leopoldo Lopez, found himself among thousands at a recent street demonstration in support of Ortega, whose office prosecuted Lopez.

"Every Mandela needs a De Klerk," he said, referring to the white president who oversaw the end of apartheid in South Africa.

The Venezuelan opposition's embrace of Ortega, however tactical and awkward, underscores a stark truth after three months of paralyzing but so far unsuccessful protests: Removing Maduro will require winning over some of his backers.

Ortega, the most prominent defector so far, brings a unique combination of impeccable revolutionary credentials, intimate knowledge of the government's inner workings and a semi-autonomous post with which to challenge the government's moves to centralize power and crush the opposition.

"What most worries the government is a schism inside the ruling movement," said Francisco Toro, editor of pro-opposition blog Caracas Chronicles. "In that regard she's more of a threat than 200,000 people on the street."

Until recently, Venezuelans knew little about the bespectacled 59-year-old lawyer other than watching her on state TV for years closely toeing the government line.

The daughter of a cattle rancher from Venezuela's central plains, Ortega studied law in the city of Valencia, where she helped organize protests of students and textile workers in the late 1970s as a member of the legal wing of a clandestine guerrilla group known as the Party of Venezuelan Revolution.

Douglas Bravo, who led the now-disbanded Marxist group, remembers her as hard-working and talented foot soldier.

"She was always someone who stood for the principles of democracy, respect for human rights and anti-imperialism," he said.

After Chavez took office in 1999, Ortega moved to Caracas to work as legal adviser to a state-owned TV channel. She became a federal prosecutor in 2002 and was handed some of the highest-profile cases, including prosecution of people who organized a brief coup against Chavez that year.

She was named chief prosecutor in 2007 and was re-elected to the post by the then pro-Maduro National Assembly in 2014 over a rival candidate reportedly close to first lady Cilia Flores.

Her transformation occurred gradually, according to her husband, socialist party lawmaker German Ferrer.

After Chavez's death in 2013, Ortega was irked when top government officials moved to stifle some corruption probes, he said. She also began to distance herself, sometimes publicly, from Maduro's increasingly heavy-handed approach to policing in poor neighborhoods, as well as the use of firearms and pro-government militias to control protests. In 2016, she shocked many by publishing homicide statistics — something that hadn't been done in years by the government, which was embarrassed by spiraling violence.

For the most part, though, she kept her misgivings under wraps.

"The moment we stuck our neck outs we knew what the consequences were going to be," said Ferrer, a partner in his wife's carefully planned rebellion. "A misstep at the wrong time could have proven fatal."

An opening came when the government-stacked supreme court gutted the now opposition-led National Assembly of its last powers in late March, triggering protests that have so far left more than 90 dead and 1,500 injured. Ortega broke her silence, accusing the government of a democratic "rupture."

Since then, she has sharpened her criticism, accusing the government of "state terrorism" and Maduro of dismantling Venezuela's democracy with plans to rewrite the constitution that was sponsored by Chavez.

She has also brought charges against the head of the national guard and intelligence police alleging human rights abuses in the crackdown on protests.

Many in the opposition suspect she has access to damaging information about corruption in Maduro's inner circle. On Wednesday, her office said it was investigating the wife and mother-in-law of Maduro's former Transport Minister Haiman El Troudi for alleged involvement in a corruption scandal involving Brazilian construction giant Odebrecht. As part of a plea agreement with the U.S. Justice Department last year, that company admitted to paying almost $100 million in bribes to Venezuelan officials

Ortega couches her criticism in the language of Chavez when speaking to Venezuelans, many of whom still revere the charismatic leader. Polls say they are fed up with Maduro but also distrust the traditionally elite-dominated opposition.

The government has retaliated with attempts to discredit and oust Ortega.

Ferrer said that in the days after his wife broke with Maduro, the government removed her security detail of 10 armed bodyguards and cars from the feared intelligence police appeared parked outside her office.

When she asked the supreme court to nullify the previous legislature's rushed, lame-duck appointment of 13 magistrates, socialist party leaders called for her to undergo a psychiatric evaluation. They also initiated Supreme Court proceedings to remove her from office in apparent violation of the constitution, which says only congress has the right to hire and fire the nation's top law enforcement official.

Not everyone is convinced of her transformation. Some in the opposition say she was looking to whitewash her record on the eve of retirement and avoid being targeted by U.S. sanctions imposed on other Venezuelan judges and prosecutors. They also haven't forgiven her role in prosecuting demonstrators during crackdowns on anti-government protests in 2014.

"Her current actions do not magically erase her responsibility for abuses committed under her watch," said Jose Miguel Vivanco, the Americas director at Human Rights Watch. "But her past does not tarnish the relevance of the exceptional contribution she's making today by using the power of her office to help expose Maduro's repressive machinery."


Joshua Goodman on Twitter: https://twitter.com/apjoshgoodman.