A former U.S. defense intelligence analyst who was convicted of spying for Cuba more than 20 years ago has been released from a federal prison in Fort Worth, Texas.

Ana Belen Montes, 65, was released Friday, Federal Bureau of Prisons spokesperson Scott Taylor said Saturday.

Montes, an analyst for the U.S. Defense Intelligence Agency, was arrested in September 2001 and charged with spying for Cuba.

Montes pleaded guilty in 2002 to conspiring to commit espionage as part of a plea deal with federal prosecutors and was sentenced to 25 years in prison.

She acknowledged revealing the identities of four undercover agents for the U.S. to Cuban authorities and had faced a possible death sentence if convicted.

Federal prosecutors at the time said the four agents whose identities she revealed were not harmed.

U.S. prosecutors also accused Montes of disclosing to Cuba secrets so sensitive they could not be described publicly. Court records said she provided documents that revealed details about U.S. surveillance of Cuban weapons.

Officials at the time said Montes was believed to have been recruited by Cuban intelligence when she worked in the Freedom of Information office at the Justice Department between 1979 and 1985 and was asked to seek work at an agency that would provide more useful information to Cuba.

She began working for the Defense Intelligence Agency starting in 1985 and was considered a top analyst on the Cuban military.