WASHINGTON (CNN) -- A 72-year-old former State Department employee and his 71-year-old wife have been arrested and charged with illegally aiding the government of Cuba for nearly 30 years, the Department of Justice announced Friday.

Walter Kendall Myers retired from the State Department in October 2007.

Walter Kendall Myers and his wife, Gwendolyn Myers, were charged with conspiracy to act as illegal agents of the Cuban government, providing classified information to that government, and wire fraud, according to court documents unsealed in Washington.

The couple appeared briefly Friday before a federal magistrate in Washington, who ordered them held without bail pending a detention hearing Wednesday. Judge John Facciolo agreed with prosecutors that the couple might try to flee the country if not held.

They were arrested late Thursday, the Justice Department said.

The State Department isn't clear at this stage on what information the Myerses may have passed to their Cuban handlers, according to a senior State Department official, who said that such information would come out of a full damage assessment.

"We were confident" at the time of Kendall Myers' retirement, the official said, that he had been passing information to Cuban intelligence. Diplomatic security officials "let it go for a while" to see what information might emerge.

The official said Myers was an "upper-level civil service employee." He was a European analyst at the Bureau of Intelligence and Research and "had come up in the ranks," the official said.

The official also said it was unclear whether Myers acted for financial reasons, but a law enforcement official said the couple's primary motive was not money. The couple were "true believers" in the Cuban system, the official said.

"The abuses of our system, the lack of decent medical system, the oil companies and their undisguised indifference to public needs, the complacency about the poor, the utter inability of those who are oppressed to recognize their own condition," Myers wrote in a diary quoted in the federal affidavit.

"Have the Cubans given up their personal freedom to get material security? Nothing I have seen yet suggests that," he wrote. "I can see nothing of value that has been lost by the revolution. The revolution has released enormous potential and liberated the Cuban spirit."

Although they were paid for "expenses" by the Cuban government, most of their funds, including a half-million dollar brokerage account, may be largely from Myers' government salary, the official said.

However, the government intends to move to seize money derived from his employment on the basis that it was obtained as a fraud, because he was really working against the U.S. government.

The indictment, made public Friday, says Kendall Myers, known to Cuban intelligence as Agent 202, and Gwendolyn Myers, known as Agent 123 and Agent E-634, engaged in activities "which spanned nearly three decades."

Conviction on the wire fraud charge would carry a sentence of up to 20 years, illegally acting as an agent of a foreign government would carry a sentence of up to 10 years, and the conspiracy charge would carry a sentence of up to five years.

A Justice Department official said counterespionage agents had gathered information on the Myerses and set up an April 15 meeting at which an FBI undercover agent convinced the couple that he had been contacted by Cuban intelligence and was to ascertain the scope of their activities. They fell for the ruse, the department said.

The court documents say the couple disclosed that they had received coded messages via shortwave radio, had met with Cuban agents in Mexico and had been carefully watching for any sign of U.S. surveillance.

An affidavit released by the court said Kendall Myers had first traveled to Cuba in 1978, and Cuban intelligence then began to develop him as a Cuban agent. Six months later, Myers and his wife agreed to work for the Cuban service.

After the April 15 meeting, the Myerses are said to have agreed to provide the undercover agent with information on the April 17-19 Summit of the Americas in Trinidad and Tobago, which President Obama attended.

Kendall Myers confided to the undercover agent that he had received a "lot of medals" from the Cuban government for his work and that he and his wife spent an evening with Fidel Castro in 1995.

The affidavit quotes Kendall Myers as telling the agent that he typically removed information from the State Department by memory or by taking notes -- although he did occasionally take some documents home -- and had delivered information that was classified "secret."

Myers retired from the State Department on October 31, 2007. He had viewed more than 200 classified reports on Cuba in his final months, even though he was at the time an analyst working on European issues, the court document said.

CNN's Jill Dougherty contributed to this report.

All About Cuba • Espionage and Intelligence