A federal magistrate judge in Washington ordered a Russian woman detained Wednesday, pending her trial on charges she served as a covert agent for Moscow while living in the United States.

In front of a packed courtroom, U.S. Magistrate Judge Deborah A. Robinson of the District of Columbia sided with prosecutors’ view that the woman, Maria Butina, posed a flight risk, in part because of connections to Russian intelligence that the Justice Department laid out in a filing submitted just hours before the hearing.