An American activist convicted of aiding leftist rebels has been returned to prison after a court struck down a decision granting her parole. It ordered her to return to prison, where she is to remain with her 15-month-old son.

Lori Berenson, who was released in May after serving 15 years of a 20-year sentence for terrorist collaboration, was arrested by police at the US embassy. She was at a "regular consular meeting" to keep officials apprised of her situation, her father said.

"She's calm. She is a very strong woman," her husband and lawyer, Anibal Apari who she met in prison, told reporters outside the embassy. "She is going to return to jail with her baby."

As she was led to a courthouse cell, Berenson carried her son in her arms.

The 40-year-old said that her case had become a political football in an election year as many former rebels are running for office.

The criminal appeals court ruling was announced two days after she appeared at a hearing, apologising for her crime and asking the court to uphold her parole. Berenson told the court on Monday that she regretted her actions and hoped to focus on raising on her son, Salvador.

She told journalists that her case had become a political football in an election year.

Some former rebels are running for office in state and municipal elections in October, and Berenson is viewed by many Peruvians as a symbol of the left-wing violence that afflicted the nation two decades ago.

"I think there are various people – not all of them are politicians – who think this is an issue where it looks good to be a hardliner. It even seems like there's competition to see who can be the toughest on this issue," she said.

Berenson has acknowledged collaborating with the Tupac Amaru Revolutionary Movement, but said she was never a member of the group nor involved in violent acts.

President Alan Garcia has the power to commute Berenson's sentence, which would allow for her immediate deportation. But he has said he will wait for justice to run its course before making any decision.

Deputy justice minister Luis Marill said the court struck down the 27 May decision that granted Berenson's parole – a decision that was widely unpopular in Peru.

The appeals court annulled the decision because Berenson's defense had not promptly complied with a requirement to notify police of the address where she would live upon her release, a process that also required verification by authorities. The ruling returned the case to the lower court judge who authorised the parole.

Apari expressed confidence the judge could rule again in two or three weeks once that issue is resolved, saying "it's only that her domicile needs to be verified".

Julio Galindo, the government's lead anti-terrorism prosecutor, told the Peruvian radio station Radioprogramas that the process is likely to take about two months and that if the judge decides in Berenson's favour again, she would go free.

Marill called it "probable" that the judge could decide to free Berenson again on parole, but added: "That's going to depend a great deal on the efforts of the prosecutor's office" and other factors, including police reports.

Her father, Mark Berenson, told the AP that the parole decision "was annulled on a technicality".

"We are still in an unsure position," he said in an email exchange in which he was asked if he and his wife would remain in Lima for now. "We haven't figured out our future plans – we are still numb."

In Monday's interview, Berenson said that what pained her the most was the thought of being separated from her son. Peruvian penal regulations dictate that children may only stay with jailed mothers until age three.

Her father says the boy has both US and Peruvian passports.

Berenson was initially accused of being a leader of the Tupac Amaru, which bombed banks and kidnapped and killed civilians in the 1980s and 1990s.

When she was arrested in November 1995 with the wife of the group's leader, prosecutors said she was helping plot a takeover of Peru's Congress.

She was convicted of treason by a military court in 1996 and sentenced to life. But after an intense campaign by her parents and pressure from the US government, she was retried in a civilian court. In 2001 it convicted her of the lesser crime of terrorist collaboration and sentenced her to 20 years.

Galindo, the prosecutor, has argued there were errors in the ruling that granted parole, including that Berenson's time served in prison was incorrectly calculated. He also questioned whether Berenson has cut all links to the rebel group.

Berenson is widely remembered in Peru for steadfastly defending the Tupac Amaru rebels for long after her 1995 arrest. She maintained she was a political prisoner even after her 2000 retrial.

Many Peruvians disapproved of Berenson's release, and congressmen of multiple parties praised the ruling to send her back behind bars.

"I think we shouldn't give a single millimetre to terrorism," said lawmaker Carlos Raffo, who belongs to the party of former president Alberto Fujimori, during whose government Berenson was prosecuted and imprisoned.