(Pool/Getty Images)

A former CIA officer sold top secret and other classified documents to Chinese intelligence officials, according to charges filed Thursday in Alexandria federal court.

Kevin Patrick Mallory, 60, of Leesburg, Va., was arrested Thursday and appeared briefly in front of Judge Theresa Buchanan on counts of delivering defense information to aid a foreign government and making false statements. He asked to be represented by a public defender.

Mallory had a top secret security clearance until he left the government in 2012, prosecutors say, having worked at various government agencies and defense contractors.

Although the primary government agency in question is not named, two government officials confirm that Mallory worked for the CIA.

Prosecutors say Mallory sent three documents containing classified information, one of which was labeled top secret, to a Chinese intelligence operative in May.

“Your object is to gain information, and my object is to be paid for it,” Mallory wrote to the Chinese contact at around the same time, according to an affidavit from FBI agent Stephen Green filed in federal court. Mallory allegedly added that he would “bring the remainder of the documents” on a June trip.

“My current object is to make sure your security (sic) and try to reimburse you,” the operative allegedly replied.

The CIA declined to comment Thursday.

According to the affidavit, Mallory told FBI agents in May that he had been contacted in February on a social media site by a recruiter for a Chinese think tank, the Shanghai Academy of Social Sciences. He spoke on the phone with the recruiter and was then introduced to a potential client, whom he traveled to Shanghai to meet in both March and April.

In March, Mallory allegedly reached out to several former CIA coworkers and asked for help getting in touch with a specific department. He told one employee that he believed the people he had met with were working for Chinese intelligence, according to Green. He allegedly also said he had been given a device to communicate securely with the Chinese agent and been taught how to use it.

Expecting to meet with the same CIA employee in May, Mallory was instead greeted by FBI agents. He let them search the device given to him by the Chinese operative. But, according to Green’s affidavit, Mallory was surprised that past conversations on the device had not been erased. He was showing the agents how to move a message from normal to secure mode when the secure messages appeared.

Mallory allegedly told the Chinese agents he had destroyed his paper records and planned to destroy all electronic records once they were sent.

He told the agents the documents on the phone were merely white papers he had written based on his own knowledge. While he told the FBI agents he had been paid $25,000 by the Chinese operatives, the court files show, he said the money was only for his consulting services in the country and expenses.

Between 1990 and 2012 Mallory was stationed in Iraq, China and Taiwan; he is fluent in Mandarin Chinese. He founded a consulting company, GlobalEx, in 2010.

He attended Brigham Young University and then served in the military. He also served in active army deployments in more recent years.

Charlie Sherrod, a friend and former financial advisor, was shocked by the arrest and charges.

“I find it very hard to believe that he would do something like that,” he said Thursday. He knew Mallory as “a strong Christian and a family man.”

A woman who answered the phone at Mallory’s residence said she was unfamiliar with the charges and wanted to consult a lawyer before commenting.

Mallory appeared in court wearing a loose tank top and gym shorts.

He faces up to life in prison. He will return to court Friday for a detention and preliminary hearing.

“The conduct alleged in this complaint is serious and should send a message to anyone who would consider violating the public’s trust and compromising our national security by disclosing classified information,” said Dana J. Boente, Acting Assistant Attorney General for National Security and the U.S. Attorney for the Eastern District of Virginia.

Devlin Barrett contributed to this report.