(BETHESDA, Md.) — The firearm used by a man police say killed his wife before going on a deadly shooting spree in the Maryland suburbs late last week was purchased legally before the killings took place. It was not turned over to law enforcement, despite a protective order and the seizure of some of his other guns last month, said Montgomery County State’s Attorney John McCarthy Monday outside court.

Eulalio Tordil, who is facing first-degree murder and other charges, will be held without bond, a judge ruled. Tordil appeared for the first time Monday in court via video in a blue button-down shirt with his hands handcuffed behind his back.

McCarthy argued that Tordil was a flight risk, saying that his alleged victims Friday were “completely random” and killed during alleged attempted carjackings.

Suicide notes that were apparently written in March and mentioned a shootout with police were obtained by law enforcement prior to Tordil’s arrest Friday, according to McCarthy.

License plate readers around the Washington, D.C., area showed that Tordil “drove all over the place” between the Thursday shooting of his wife and Friday’s shootings, according to McCarthy. No immediate reason is known as to why.

McCarthy said that Tordil’s Glock was purchased legally in Las Vegas in 2014, before a protective order was filed by his wife.

According to police, the shooting spree began Thursday when Eulalio Tordil, 62, followed his estranged wife, Gladys Tordil, when she went to pick up her daughter at High Point High School in Beltsville in Prince George’s County. Police said Tordil fatally shot her and shot and injured a Good Samaritan who rushed to help her.

Tordil, an officer with the Federal Protective Service, which helps secure federal buildings, had been placed on administrative leave after a court order demanded that he stay away from his wife, who had accused him of beating her. Due to that court order, he was not supposed to possess any firearms.

The Montgomery County Sheriff’s Office seized some of his firearms because of that court order. McCarthy said that authorities believe there are other guns floating around that were not recovered in the home search, but did not specify how many or what kind.

On Friday, as the manhunt for Tordil continued, Tordil allegedly tried to carjack a woman at Westfield Montgomery Mall in Bethesda, and two men rushed to help her. Tordil allegedly shot all three of them, one fatally, police said.

“These two men acted selflessly and heroically,” said Montgomery County police Assistant Chief Russ Hamill. “Not only coming to her aid, but likely saving her life.”

Shortly after the mall shooting, another shooting outside of a grocery store left a woman dead. Police believe it was another allegedly botched carjacking attempt by Tordil.

Tordil’s next hearing will be June 3. He is being represented by a public defender and has not yet entered a plea to the charges against him.