(CNN) She put American combat troops in harm's way, betrayed her own people and handed over so many secrets that experts say the U.S. may never know the full extent of the damage.

Ana Montes was the Queen of Cuba, an American who from 1985 to the September 11, 2001 attacks handed over U.S. military secrets to Havana while working as a top analyst for the Pentagon's Defense Intelligence Agency.

But despite her crimes, Montes remains largely unknown.

You might not think Cuba could do much harm to a superpower like the U.S., said retired DIA official Chris Simmons, appearing on CNN's "Declassified."

But you'd be wrong.

The threat increases, he said, when Havana goes on to sell those U.S. military secrets to nations like China, Russia, Iran, Venezuela and North Korea.

Ana Montes

Montes' anger about U.S. foreign policy complicated her relationships and drew the attention of Cubans who enticed her to turn her back on friends, family and her own country.

The fascinating spycraft that surfaced from her case offers a rare glimpse into the invisible world of espionage, where some experts believe there could be as many as 100,000 foreign agents working inside the U.S.

The two Anas

Montes grew up like millions of other girls during the Cold War, in a large, middle-class family, the oldest of four children.

Born to Puerto Rican parents on a U.S. Army base in Germany in 1957, Montes' father served his country as an Army doctor. By the time Montes entered high school, her father had left the military and settled the family about an hour north of Washington, D.C., in Towson, Maryland.

She attended the University of Virginia, and in 1977 and 1978, she spent a liberating year studying in Spain. There, she met a Puerto Rican student named Ana Colon.

The two Anas quickly became friends -- bonding through their Puerto Rican roots -- not politics. "I had no political awareness whatsoever," said Colon, now a Washington-area elementary school teacher.

But Montes, at age 20, was quite the opposite.

"She was already very much against the United States" because of the "abuse the United States had done" by manipulating governments in Central and South American nations, said Colon.

"And it didn't help that everybody we would hang out with also was against the United States," she added.

At the end of their year abroad, the two Anas kept in touch by writing letters.

How she was recruited

By 1984, Montes had finished at UVA and was working a clerical job at the Justice Department in Washington and studying for a master's degree at Johns Hopkins University.

She often found herself railing against President Ronald Reagan's support for rebels fighting pro-communist regimes in Central America.

"She felt that the U.S. didn't have the right to impose its will on other countries," said FBI Special Agent Pete Lapp, the man who eventually led the investigation against Montes, and ultimately arrested her.

JUST WATCHED How spies conduct dead drops Replay More Videos ... MUST WATCH How spies conduct dead drops 00:58

Someone at Johns Hopkins noticed Montes' passionate views about Cuba and soon she was introduced to recruiters and agreeing to help the Cuban cause.

At about the same time, Montes applied for a job at the Defense Intelligence Agency, where workers handle U.S. military secrets on a daily basis. When she started there in 1985, the FBI says she was already a fully recruited Cuban spy.

In March 1985, Montes made her first clandestine espionage trip to Cuba via Madrid and Prague, according to a now-declassified top secret Defense Department report

When she got back, Montes ran into her college friend Ana Colon. Apparently Montes felt comfortable enough with Colon to discuss the secret trip.

"She talked about how repressed the people were and about visiting military bases," Colon said. "Later on, through the FBI, I found out that that trip was when she had been trained to be a spy."

After Montes settled into her job at the DIA, her letters to Colon stopped, Colon said. "She cut me off, and I had no idea what had happened." Years later, the FBI theorized that Montes cut off communication with Colon because she knew too much about Montes' Cuban activities.

How she stole information

At the DIA, Montes chose an espionage technique that helped her evade detection for 16 years. One reason she kept her secret for so long was the fact that she never took any documents or electronic files home from work, the FBI said.

Instead, Montes memorized details from sensitive documents and then — when she got home — typed them from memory onto her laptop.

Next, Montes would copy her typed information onto encrypted discs. Then she'd receive coded instructions via shortwave radio about where to hand over the discs to her Cuban contacts.

Ana Montes with then-Deputy DCI George Tenet, after receiving an award.

All the while she quickly rose through the ranks. Montes was considered a model employee and in 1997 she was awarded a certificate of distinction. Her stellar reputation earned her the nickname the Queen of Cuba among her DIA co-workers.

How she got caught

One night in 1996 Montes was called to consult at the Pentagon during an ongoing international incident. Montes broke protocol by failing to remain on duty until dismissed. DIA counterintelligence officer Scott Carmichael wondered why.

Carmichael reviewed her personnel file. He noted Montes' sparkling record. But he decided to bring Montes in for questioning anyway. At the end of their meeting Carmichael came away feeling like Montes was hiding something — although he had no idea what. He had to let it go.

JUST WATCHED How the U.S. busted a Cuban spy Replay More Videos ... MUST WATCH How the U.S. busted a Cuban spy 01:25

Four years later, Carmichael heard the FBI was looking for a mole — an unidentified spy inside the DIA who was working for Cuba.

The suspect had traveled to the U.S. Naval Base at Guantanamo Bay, Cuba, at a specific time. When he looked up a list of DIA employees who visited Gitmo during those dates, a familiar name popped up — Ana Montes.

"The moment I saw her name, I knew," Carmichael said.

After that, Carmichael and FBI agent Lapp teamed up to prove that the DIA's Queen of Cuba was really a spy.

Thanks to "very sensitive" intelligence, it was known that the unidentified DIA mole had bought a specific brand, make and model of computer at a specific time in 1996 from an unknown store in Alexandria, Virginia.

Lapp was able to find the store's original record that linked that computer to Montes.

That's how the FBI knew for sure Montes was the spy they were looking for.

Tradecraft

Next, the FBI wanted to catch Montes in the act of spying.

So, they tapped her phones.

They staked her out.

JUST WATCHED What goes into a stakeout Replay More Videos ... MUST WATCH What goes into a stakeout 00:53

They followed her.

They noticed her patterns.

They figured out that Montes was walking to various pay phones around Washington and stopping to making calls.

When they traced the digits she was calling, the numbers led to pagers in New York City.

"We knew those particular numbers were associated with Cuban espionage," Simmons said. "She was sending signals. That told us she was still active."

Searching Montes' home while she was out of town, FBI agents found a shortwave radio that her Cuban handlers used to send her messages.

Next, the FBI concocted a plan to distract Montes at work so they could search her purse.

JUST WATCHED How do spies use cryptography? Replay More Videos ... MUST WATCH How do spies use cryptography? 01:08

Inside, they found a piece of paper that listed the code system Montes used to communicate with the Cubans via the pay phones and pagers.

Now the FBI could decipher the messages Montes was sending to her handlers.

Now they knew what she was thinking.

9/11 changes the plan

The 9/11 attacks shortened the Montes investigation, ending any hope of catching Montes' Cuban handlers. She'd been chosen for a team that would analyze bombed targets after the U.S. invasion of Afghanistan -- which would have given her access to Pentagon war plans. The time had come to arrest the Queen of Cuba.

JUST WATCHED An American female spy goes undercover in Moscow Replay More Videos ... MUST WATCH An American female spy goes undercover in Moscow 01:31

On September 21, 2001, Montes was called into a DIA conference room and Lapp placed her under arrest, putting an end to the career of one of the most potentially damaging spies in recent U.S. history.

Looking back on the entire investigation, a Defense Department counterintelligence official was quoted in one report saying, "The only reason we caught her is because we got lucky."

Acts of betrayal

Montes and her lawyers struck a plea bargain with prosecutors, pleading guilty to one count of conspiracy to commit espionage. In exchange, Montes got a 25-year prison sentence and five years probation, and she avoided the publicity of a trial.

JUST WATCHED How spy interrogation led to the capture of Saddam Hussein Replay More Videos ... MUST WATCH How spy interrogation led to the capture of Saddam Hussein 01:25

She agreed to tell the FBI and other authorities details about her spying activities from the time she began in 1985 to the day she was arrested. Those grueling five or six-hour debriefing sessions took place three days a week for about seven months.

Some of the most damaging information Montes admitted giving to Cuba, the FBI said, were the identities of four American undercover intelligence officers working there.

Simmons said she passed Cuba information about the location of U.S. Special Forces in El Salvador in the 1980s. "I'm convinced she willfully and intentionally took every action she could to get Americans killed in combat," he said. "It should make us all enraged."

Why she did it

Clearly Montes wasn't in it for the money.

Unlike the FBI's Robert Hanssen -- who got $600,000 from the KGB — or the CIA's Aldrich Ames -- who got $2.5 million from Moscow -- Montes took no money for the secrets she gave to the Cubans, the FBI said, except payment for some expenses.

When she appeared in court to plead guilty, Montes offered a hint of an explanation.

JUST WATCHED Recruiting a Soviet to spy for America Replay More Videos ... MUST WATCH Recruiting a Soviet to spy for America 01:24

"I believe our government's policy towards Cuba is cruel and unfair," Montes told the judge. "I felt morally obligated to help the island defend itself from our efforts to impose our values and our political system on it."

"For her to say that she had no alternative but to become a spy? I think that's bulls*** -- I'm sorry," Colon said.

"She had the energy of Joan of Arc. She could have done amazing things in a legal way. But she chose to do things illegally, unnecessarily, from my point of view," said Colon. "In this country you can work against the United States from many organizations. She didn't have to do what she did."

Queen of Cuba

Now 59, the Queen of Cuba has lost her crown. Her new palace is Federal Medical Center Carswell, in Fort Worth, Texas.

According to its website, FMC Carswell is a women's prison with security levels ranging from minimum to maximum for inmates with special medical and mental health needs. It's not known if Montes has health issues that would require her to be placed there. She's scheduled for release on July 1, 2023.

The United States and Cuba have reportedly discussed a potential prisoner exchange involving Montes as part of the ongoing effort to normalize relations between the two countries, according to NBC News

Colon said they exchanged a couple of letters after Montes went to prison. But Montes remained defiant and unapologetic, Colon said.

"You're OK in her world if you support what she did -- and I don't," Colon said. "When she presents her cause, I challenge it, and she doesn't like that."

Although Colon said they haven't communicated in years, it's clear their friendship is still much more important to her than politics -- just like when they first met back in the '70s.

"This experience has been very traumatic for me. Ana was my sister," she said.

"If she would reach out to me, I would be right there for her."