A Peruvian court has granted parole to an American woman after she served 15 years in prison for aiding leftist rebels.

Lori Berenson is expected to be released from a prison in Lima on Wednesday.

The judge in the case told Berenson her release is conditional on her staying in Peru.

Berenson, who is 40, was arrested in 1995 and accused of being involved in a failed attempt by the rebel Tupac Amaru Revolutionary Movement to seize Peru's Congress.  

A military court initially convicted and sentenced her to life in prison.  That sentence was overturned in 2000 and Berenson was re-tried by a civilian court.  

She was acquitted of being an active member of the group but convicted of helping the guerrillas and was sentenced to 20 years in prison.  Berenson will be released before serving the full sentence, and has maintained her innocence.

Last May,  Berenson gave birth to a son. The infant's father is Anibal Apari, who spent 12.5 years in prison for involvement with the rebels.  He has been married to Berenson since 2003 and has been allowed to see her in prison.

Some information for this report was provided by AP and Reuters.