A New York City police officer accused of spying for China was granted bail Friday and ordered confined to his home over the objections of federal prosecutors who argued he poses a serious flight risk.

A Brooklyn federal judge ordered the release of suspended Queens cop Baimadajie Angwang on a $1 million bond. The 33-year-old has been held in federal detention since last month and charged with acting as an agent for a foreign government, obstruction, wire fraud and making false statements.

“I am prepared to release Mr. Angwang on a $1 million bond secured by the family’s residence as well as by all of your signatures,” federal Judge Lois Bloom said, referring to the Angwang's family members and friends who ensured his bond, including colleagues he served with in the Marine Corps.

Despite being ordered to wear an ankle monitor, Assistant U.S. Attorney Michael Keilty argued Angwang could easily flee by walking into the Chinese consulate in Manhattan where he could seek asylum and would be beyond the reach of U.S. authorities.

TRUMP TELLS UNITED NATIONS TO HOLD CHINA ACCOUNTABLE FOR CORONAVIRUS PANDEMIC 

New York Police officer Baimadajie Angwang, 33, is accused of working for the Chinese government by spying on supporters of the free Tibet movement. A federal judge on Friday ordered him to home confinement pending $1 million bond. (New York Police Department / NYPD 111th Precinct Twitter account)

“All he has to do is go through that tunnel, cross that bridge, walk into one of those buildings and we can never get him again. He’s gone,” he said.

But Bloom said detaining the husband and father of a young child with no clear trial date would mirror the Chinese court system, which has been accused of engaging in show trials and detaining people for long periods without criminal charges. It could years before he goes to trial due to the backlog of cases caused court closures because of the coronavirus pandemic, she said, the New York Post reported.

“There is a big difference between this country and most countries, especially the PRC [People's Republic of China]. There is a presumption of innocence in this country,” Bloom said, according to the Queens Eagle.

Bloom's order doesn't immediately go into effect and Angwang will remain in custody until another judge hears an appeal to the bond order.

Angwang worked as a community affair officer in the NYPD's 111th Precinct and serves in the Army Reserve. Federal prosecutors allege he tracked the activities of the Tibetan community and tried to infiltrate Tibetan groups in the New York area since at least 2018 and reported his findings to his Chinese handler.

Chinese Foreign Ministry spokesman Wang Wenbin previously called the charges "pure fabrication."

CLICK HERE TO GET THE FOX NEWS APP

While explaining the terms of his release, Bloom warned Angwang's wife about what home confinement means.

“He won’t be able to take out the garbage or get milk for the baby,” she said.