An FBI agent who shot a man during a confrontation aboard a moving subway train just outside Washington was indicted on attempted murder and other counts, according to Maryland court records unsealed Tuesday.

Eduardo “Eddie” Valdivia, 37, was also charged with first-degree assault, reckless endangerment, and use of a firearm in the commission of a felony stemming from the early-morning encounter six months ago on a southbound Metro Red Line train. Prosecutors say he fired two shots at the passenger, who was hospitalized with damage to three internal organs. He survived.

The agent turned himself into the Montgomery County jail Tuesday morning before Circuit Court Judge Joan Ryon later allowed him released on his own recognizance.

Law enforcement officials have described Valdivia’s actions as an extreme overreaction to an unarmed stranger who confronted the agent but did not physically assault him. In court Tuesday, prosecutors provided their most detailed accounting to date of what happened.

At the time of the encounter — about 6:40 a.m. on Dec. 15 — Valdivia was on his way to work, sitting with his back to a corner of the train car. The stranger approached and sat across the aisle, Montgomery County Assistant State’s Attorney Robert Hill said. The two exchanged a nonconfrontational fist-elbow bump. The man panhandled for money. Valdivia declined to give him any, saying he didn’t have any, and the stranger began to leave that part of the train, Hill said.

“He was muttering expletives as he walked away,” Hill said, adding that the encounter was captured on surveillance video. “The defendant stood up and said to the victim, ‘Watch your mouth.’ This prompted the victim to turn around and to approach the defendant again.”

A verbal confrontation ensued and the agent told the man several times to back up, Hill said. The agent “then produced a handgun from a holster on his waist and shot the victim twice from a distance of approximately two to three feet,” Hill said.

Valdivia helped the man off the train and called out for medical assistance, Hill said. The prosecutor added that Valdivia didn’t say he was an FBI agent until after the shooting.

Valdivia’s attorney, Robert Bonsib, described the incident differently.

After the initial encounter, the man cursed and walked away, Bonsib said in court. Valdivia remained seated as he told the man to watch his mouth, according to Bonsib, which prompted the man to turn and approach within arms length of Valdivia as the agent stood up. Valdivia put his hand on his holstered gun.

“He warned him: ‘Back up or I’ll shoot,’ ” Bonsib said.

Under Maryland law, Bonsib added in an interview, a person does not have to wait to be attacked before defending himself. The agent worried the aggressive, erratically acting stranger wanted to attack him, get his gun and use it on him, Bonsib said.

“The law of self-defense permits one to act in anticipation of aggressive force to avoid being seriously injured or killed. That’s the reason Eddie Valdivia acted the way he did,” Bonsib said. “He was backed up in a corner by a man who was giving every indication he was going to attack.”

Surveillance video from the train shows that after the initial fist-elbow bump, the two men never made contact but came very close to each other.

Valdivia was a project officer at the U.S. Department of Health and Human Services, working with community health centers around the country, before joining the FBI in 2011. He worked on undercover assignments and most recently was a supervisory special agent at FBI headquarters, providing “operational guidance” on domestic terrorism investigations, Bonsib said.

Bonsib said he intends to make the criminal record of the man shot — much of it from incidents on the Metro system — central to the case. Bonsib said the man’s “history of assaultive behavior” was critical “to appreciate what Eddie Valdivia was facing when he was repeatedly confronted.”

Over the last 10 years, the man has picked up approximately 15 convictions in the Washington region, according to a review of area court records. None of the 15 convictions were felonies and none involved weapons.

Four of the convictions were for assaults, including a 2012 case for assaulting a police officer during an arrest. At least eight convictions are related to lewd conduct directed at women, mostly on the Metro system. Judges had forbidden him from riding the Metro as part of his probation unless he was going to and from case and court matters.

The agent wouldn’t have known about his past, though.

“Eddie didn’t know him,” Bonsib said. “He was a complete stranger.”

Darrell Robinson, an attorney for the man who was shot, said his client’s gunshot wounds were life-threatening. Robinson said his client’s past has nothing to do with the shooting in December.

“I understand why Mr. Bonsib would try to make these comments to try to blame the victim,” Robinson said. “He’s just advocating for his client.”

But Robinson said, “bringing up my client’s past is totally irrelevant to what occurred.”

It is not clear how much of that record would play in a trial against the agent. Judges routinely halt the introduction of a victim’s or witness's past conduct if it is deemed overly prejudicial or not directly relevant to the matter at hand. If his record does become part of the trial, according to longtime Maryland attorneys who have followed the case, prosecutors could deflect it.

“They could say, ‘Yeah, he might have harassed other people on the Metro. That hardly means he deserved to be shot,’ ” said David Felsen, a longtime defense attorney who is not involved in the case.

Felsen said it’s difficult to know how much of that past jurors would ever see. “But in my eyes it weakens the prosecutors’ case because they’ll be reluctant to put him on the stand,” he said.

Montgomery County prosecutors, though, have demonstrated a willingness to try cases built on video evidence while avoiding bringing in a key witness. In 2019, they secured a misdemeanor assault conviction against a Montgomery County police officer who was captured on two citizen cellphone videos driving his knee into a handcuffed suspect. The victim in the case, who had been trying to sell psilocybin mushrooms, did not testify. The officer’s conviction was later struck down by a judge who felt he had a good record and deemed his actions completely out of character for the officer.

As for the issue of using deadly force for self-defense, Maryland law would require Valdivia to show several factors: He believed he was in imminent danger of death or serious bodily injury; that belief was reasonable; he had no way of retreating; he used no more force than was “reasonably necessary” to halt the threat.

“You’re not allowed to use deadly force to repel an insubstantial threat,” Felsen said. “In most cases, if someone comes at you without a weapon and you use a weapon, you’re in some trouble.”

But he emphasized that such analysis hinges on the precise circumstances and details of individual cases, which can make reactions to some unarmed people who approach more reasonable.

In Maryland, a person is allowed to take a preemptive course to defend himself, said Steve Chaikin, a defense attorney in Montgomery County and a former prosecutor who is not involved in the case. The key, he said, is that the actions must be commensurate with the threat. If a person confronts you, balls up his fist and lifts his hand, you can legally punch him first, Chaikin said. By the same token, if the imminent danger is no more than a black eye, of even a broken nose, you’re generally not justified in escalating the encounter to deadly force, he said.

“The question is how would a reasonable person react to what the agent faced,” Chaikin said, adding that the agent’s concern of having his gun taken may hold weight with jurors. “I’d want to know how much of that danger was synthesized into his thinking.”

Christopher Griffiths, a longtime Maryland defense attorney not involved in the case, said the agent’s explanation that the victim was apt to get his gun will be a factual question the jury would have to answer.

“If police officers could justify a shooting simply because they had a generalized fear the person might take their gun, officers would be able to shoot people indiscriminately,” Griffiths said. “There has to be some specific facts that make the officer’s concern about losing his gun reasonable . . . The testimony of both the defendant and the victim will be crucial to the jury’s determination of this issue.”