A judge ruled Tuesday that a U.S. Customs and Border Protection supervisory agent from Santa Fe Springs is a flight risk and must remain behind bars pending trial for allegedly dealing in firearms without a permit.

Wei Xu, who was a watch commander at the Los Angeles and Long Beach Seaport when arrested in February, is accused of selling or otherwise transferring at least 70 firearms without a federal firearms license since 2014. Court papers allege Xu exploited his status as a law enforcement officer to purchase and then transfer at least 14 "off-roster" handguns that cannot be sold to the general public.

In refusing to reconsider his original detention order, U.S. Magistrate Judge Alexander F. MacKinnon determined that the 56-year-old defendant exhibited untrustworthiness and "lack of candor" when he allegedly lied to investigators about his contacts with the Chinese government.

"He has more contacts with foreign countries than the typical CPB agent," MacKinnon said, suggesting that Xu probably has the means to flee the district to avoid trial despite the offer of a $1.3 million property bond.

In his argument for bail, Xu's attorney, Mark J. Werksman, told the court that the government had tried to characterize his client as "an arch-criminal. Nothing could be further from the truth.''

Werksman said Xu was "not accused of espionage -- but all of a sudden he's being discussed as if he were Mata Hari."

Assistant U.S. Attorney Annamartine Salick alleged that, along with firearms sales, Xu had operated a forklift parts business involving partners and financial connections in China.

Xu "has a history of engaging in very serious conduct," Salick said, alleging that the defendant has lied to federal investigators, the Internal Revenue Service, the court's pretrial services division and a federal judge.

"It is not a small thing" to run a business with partners in China and "lie about it" to the U.S. government, the prosecutor said. With Xu's working knowledge of travel documents, it was easy to imagine him going to a Chinese consulate and obtaining a permit to return to China, she said.

Xu allegedly operated his firearms business by posting advertisements on internet marketplaces. According to an affidavit, an undercover law enforcement officer posing as a buyer purchased a total of four firearms from Xu, three of which were unlawfully sold out of the trunk of a car. Federal prosecutors allege the firearms included an "off-roster" pistol, high-capacity magazines, and an illegal short-barreled rifle.

Authorities seized more than 300 firearms, including numerous assault rifles, and three additional short-barreled rifles, a silencer, and more than 40 machine guns from Xu's home, according to the U.S. Attorney's Office.

MacKinnon previously rejected Xu's release on bond -- a finding subsequently affirmed by a federal judge -- stating that the defendant presents "a unique and serious flight risk."

Werksman recently filed papers in Los Angeles federal court requesting that MacKinnon reconsider pretrial release based on an offer of a $1.3 million bond secured by three properties, along with home detention and GPS ankle monitoring.

Federal prosecutors countered that Xu's close personal and business contacts in China -- which does not extradite persons in response to U.S. requests -- and his access to "substantial assets" suggest the defendant has the means to flee the district to avoid trial.

Xu faces trial in September. If convicted as charged, he would face up to 35 years in federal prison, according to the U.S. Attorney's Office.