ALEXANDRIA, Virginia — A federal magistrate judge in Virginia refused Thursday to free a former Army Green Beret who was arrested last week on a charge that he divulged U.S. military secrets to Russian intelligence agents.

U.S. Magistrate Judge John Anderson agreed with federal prosecutors that Peter Rafael Dzibinski Debbins, 45, poses a risk to flee if he is released from custody before trial.

Anderson said Justice Department prosecutor Thomas Traxler adequately explained why more than a year elapsed between the start of the investigation and Debbins’ arrest last Friday.

Traxler said investigators had to corroborate details of a confession that he said Debbins gave when FBI agents questioned him last year. Debbins mistakenly thought he could talk his way out of trouble and has a far greater incentive to flee now that he faces a maximum life sentence if he is convicted, the prosecutor said.

“The defendant has done nothing to earn the court’s trust on this matter,” Traxler said.

Defense attorney David Benowitz said Debbins voluntarily met with authorities eight times since learning about the investigation 13 months ago.

“To say that Mr. Debbins is a risk of flight, it just doesn’t fly in this case,” he said.

Debbins was charged with conspiring to gather or deliver defense information to aid a foreign government. The espionage took place from 1996 to 2011, prosecutors say.

Debbins considered himself a “loyal son of Russia,” according to the indictment, which says his mother was born in the Soviet Union and he met his wife in the Russian city of Chelyabinsk.

“Debbins thought that the United States was too dominant in the world and needed to be cut down to size,” the indictment says.

The indictment also says Debbins was motivated by bitterness over his Army career and a desire to establish business contacts in Russia.

Debbins, of Gainesville, Virginia, served in the U.S. Army from 1998 to 2005 and held Secret and later Top Secret security clearances during the time of his criminal conduct, according to the indictment.

The indictment alleges Debbins’ espionage began in late 1996 when he gave one of his Russian handlers the names of four Catholic nuns he had visited while in Russia.

He was assigned to a chemical unit in South Korea in 1998 and 1999, and the indictment says he provided his Russian handlers information about that deployment. He later deployed with his Special Forces unit to Azerbaijan and Georgia. He also is accused of providing information and names of his fellow Special Forces members.