The Peruvian opposition leader Keiko Fujimori has walked free after being jailed for more than a year pending a trial over allegations she accepted illegal campaign contributions from the Brazilian construction firm Odebrecht.

Fujimori, leader of the powerful rightwing Popular Force party, left prison in the Chorrillos district of the capital, Lima, according to a Reuters witness at the scene, where hundreds of supporters gathered outside in anticipation of her release.

Fujimori was met by her husband outside the prison with flowers and balloons. Others supporters carried the orange banners of her political party.

The country’s constitutional tribunal, Peru’s top court, ordered her release after she was handed an 18-month pre-trial sentence in October 2018.

“I have lived though the most painful moment of my life,” Fujimori told reporters, adding the decision to release her “corrected a process full of abuse and arbitrariness”.

Prosecutors allege she led a criminal organisation and received millions of dollars from Odebrecht, which is at the centre of a corruption scandal. Fujimori denies the accusations.

Fujimori is the daughter of Peru’s ex-president Alberto Fujimori, who is serving a 25-year sentence for human rights crimes and graft.

Her release comes as Peru prepares for legislative elections in January after President Martin Vizcarra dissolved Congress amid a battle with opposition lawmakers over his anti-corruption campaign. Keiko Fujimori’s party had held a majority in Congress before its dissolution.

The far-reaching Odebrecht scandal has swept through Peruvian politics. Earlier this year the former president Alan Garcia killed himself to avoid arrest in the inquiry. A number of other former presidents are also under investigation.

Fujimori, who still faces an eventual trial on the corruption allegations, said she would continue to cooperate with Peru’s judiciary. She added she would look to spend time with her family before making decisions on any other plans.

“Later I will decide what I will do in the second stage of my life,” she said. “I have had the opportunity to reflect and also realise there have been things I could have done better.”