The Justice Department on Tuesday arrested a Chinese national in Chicago who prosecutors say worked on behalf of China's intelligence agency, known as the Ministry of State Security or MSS.

Federal prosecutors say that while in the U.S. on a student visa, the Chinese national, Ji Chaoqun, worked to conduct background checks on eight people who could be recruited by China’s spy agency.

In the criminal complaint, filed Friday, the FBI said Ji paid for access to several online biographical search sites, including Spokeo, Intelius and Instant Checkmate, in order to study the backgrounds of Chinese nationals who were working as engineers and scientists in the United States.

Ji's arrest was part of an FBI investigation in Ohio into recruitment by Chinese spies over the past year.

The FBI said some of the engineers and scientists Ji researched worked for U.S. defense contractors and in the aerospace field. In addition, the agency said that Ji applied and enlisted in the U.S. Army Reserves' Military Accessions Vital to the National Interest (MAVNI) program in 2016.

Court papers describe the MAVNI program as a means to recruit foreigners who are in the U.S. legally that are considered "vital to the national interest." For example, the documents state, these people may be physicians, nurses, experts in certain languages, and cultures.

As part of that application Ji denied having had contact with a foreign government. That represents an illegal false statement, court documents say.

The FBI says it was helped in its investigation when it was able to get copies of Ji’s text messages which included a message from an intelligence officer to Ji instructing him to mail train tickets to an address in Nanjing City. According to the FBI criminal complaint, "Chinese intelligence agencies often require intelligence officers to produce itemized receipts for expenditures related to intelligence assets.”

When the FBI looked up the address to which the tickets would be mailed, images showed it was for the MSS location where Ji's intelligence officers were based, according to the complaint.

Ji Chaoqun via Facebook

His web began to unravel in the spring, according to the documents, when in April of this year Ji allegedly met with a FBI undercover agent who told Ji he was asked to contact him by a MSS intelligence officer.

Later, according to court paperwork, Ji met with the undercover agent again and detailed in audio and video recordings that he knew the people he had met in trips to Beijing and Nanjing in 2013 and 2014 respectively were Chinese intelligence officers.

Referring to the background checks, Ji allegedly told the agent, "they just wanted me to purchase some documents on their behalf. Their reason was just because it was inconvenient for them to make payments from China."

Ji made his first appearance in a Chicago court Tuesday and was ordered detained until his arraignment. Ji faces up to 10 years in prison if he is convicted.