A former California tour operator agreed to plead guilty to acting as an unregistered spy for China’s security services in hopes of getting a reduced prison sentence.

Xuehua Edward Peng, 57, agreed in court to a four-year prison term and a fine of $30,000 in a plea deal, the Associated Press reported. Peng was charged with being an illegal foreign agent who delivered information about the U.S. national security to China's Ministry of State Security (MSS).

He appeared in court on Monday and with the help of a Mandarin interpreter told the judge he understood the terms of the plea agreement and that he was guilty.

Peng said he was approached by a state security official from China in 2015 while on a business trip. He agreed to collect and deliver information for him.

However, U.S. District Judge Haywood S. Gilliam Jr. decided to decline the plea deal until the sentencing scheduled in March. Peng could face a maximum of 10 years in prison and a $250,000 fine if convicted.

Peng, a naturalized U.S. citizen, was caught in September after an elaborate FBI sting operation. He used to leave cash in hotel rooms in return for classified national security information on small electronic storage devices. He made six trips to collect packages left in California and Georgia, leaving behind as much as $20,000 in envelopes at a time, prosecutors said.

“I was never informed of the contents of these devices and at no time learned what information was stored on them,” Peng stated in the agreement.

For acting as a courier, Peng said he got paid at least $30,000. Communication was initially carried out through telephone and then on encrypted messaging platform WeChat.

Peng entered the U.S. in 2001 on a temporary business visa and became a permanent resident in 2006 after his marriage. He was naturalized in 2012. According to public records, Peng is listed as the president of U.S. Tour and Travel in San Francisco.

A Chinese scientist has pleaded guilty to stealing trade secrets from a US petroleum company, the US Department of Justice said
A Chinese scientist has pleaded guilty to stealing trade secrets from a U.S. petroleum company, the U.S. Department of Justice said. AFP/Alastair Pike