A Washington, D.C. federal judge denied prosecutors motion to detain the two men who were charged with impersonating federal law enforcement officers until their trial, saying that they did not prove that the men created a flight risk.

Arian Taherzadeh, 40, and Haider Ali, 35, were both arrested at a luxury apartment in the Navy Yard area of Washington, D.C., on April 6 during a multi-federal government agency raid of several apartment units. They were charged with false impersonation of a federal officer in a U.S. District Court on Thursday.

Magistrate Judge Michael Harvey said in a detention hearing held on Tuesday that federal prosecutors failed to prove that Taherzadeh and Ali were a flight risk, and also pointed out several issues with arguments made by the prosecutors.

Harvey said that the apartments allegedly used by the two men, including the ones that were given to Secret Service agents, did not appear to have been paid for, and noted that there's a default judgement for the apartments.

DC APARTMENT THAT HOUSED ALLEGED FAKE FEDS HIRES NATIONAL SECURITY FIRM FOR 'COMPLETE AUDIT'

"That doesn’t sound to me like something a foreign agent would do," Harvey said.

Harvey also noted that the crime that the two men are accused of are a "Class E" felony, which is the lowest.

Federal prosecutors initially argued that the men are a flight risk if they are released before trial, stating that Ali has allegedly traveled to several countries in the Middle East, including Pakistan and Iran.

Lawyers for both men said that they will not attempt to flee the country.

Taherzadeh's lawyer argued that federal prosecutors have no evidence to their claim that the gifts were given to Secret Service agents as a way to influence them, and even said that they were given out of friends.

Prosecutors also revealed at Tuesday's hearing that the men were tipped off about the federal investigation because of an email sent by a Secret Service investigator who contacted Taherzadeh’s business email, causing the government to arrest the men earlier than intended.

Taherzadeh and Ali's scheme allegedly posing as federal law enforcement agents began to fall apart when a United States Postal Inspector arrived at their apartment complex to investigate an alleged assault involving a United States Postal Service carrier, according to prosecutors.

DC JUDGE WANTS DEEPER PROBE OF POSSIBLE FOREIGN TIES FOR MEN WHO ALLEGEDLY IMPERSONATED FEDERAL AGENTS

Washington, D.C. Apartment

Federal law enforcement agencies enter an apartment building in Washington, D.C. (Fox News/Kelly Laco)

The case was eventually given to the Federal Bureau of Investigations after the men identified themselves as employees of the Department of Homeland Security who worked on a special task force related to the Jan. 6 Capitol riot. They used their fake law enforcement positions to integrate with legitimate federal agents who they gave gifts, prosecutors allege.

Federal prosecutors allege that Taherzadeh and Ali used their fake law enforcement positions to integrate with legitimate federal agents to whom they gave gifts. They also allege that the men "compromised" Secret Service personnel who have access to the White House "by lavishing gifts upon them, including rent-free living."

Prosecutors allege that the individuals "compromised" Secret Service personnel who have access to the White House "by lavishing gifts upon them, including rent-free living."

On April 6, federal law enforcement officers recovered multiple firearms as well as ammunition while executing a search warrant. According to a court filing by federal prosecutors on April 7, "numerous electronic devices" were also found, including a "significant" amount of surveillance equipment, 30 hard drives, a machine that creates and programs Personal Identification Verification cards, and blank cards with chips.

WASHINGTON D.C. MEN WHO ALLEGEDLY POSED AS FEDERAL AGENTS HAD STOCKPILE OF WEAPONS, NEW FILING SHOWS

Files

A court filing by prosecutors on Friday states that "a box of documents with profiles of individual people" and "a binder containing a list of residents, apartment numbers, and contact information" were found when federal agents executed the search warrant. (Department of Justice)

Residents of the luxury apartment told an inspector that the two men set up video surveillance throughout the apartment complex, and said they believe that they had access to personal information, and even said that the men claimed they could access residents' cell phones.

A court filing by prosecutors on April 8 states that "a box of documents with profiles of individual people" and "a binder containing a list of residents, apartment numbers, and contact information" were found when federal agents executed the search warrant.

Fox News has confirmed that of the four Secret Service agents suspended in connection with the investigation, two of them worked for the uniformed division, and one of the agents' duties was in the vicinity of the residence of Vice President Harris, but not on her person detail.

CLICK HERE TO GET THE FOX NEWS APP

A separate Secret Service agent who is now suspended was assigned to the Presidential Protective Division of First lady Jill Biden, and sources tell Fox News that it's possible this agent filled in for agents close to President Biden at times but was not on the president's regular security detail.

Fox News' Jake Gibson contributed to this report