A former California tour operator accused of spying for China’s security service pleaded guilty Monday in hopes of 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 negotiated with prosecutors after they charged him with being an illegal foreign agent who delivered U.S. national security information to the Chinese government.

U.S. District Judge Haywood S. Gilliam Jr. declined to accept Peng’s plea deal until sentencing, which is scheduled for March.

Peng, who is a naturalized U.S. citizen, has been in federal custody since late September when he was arrested at his Hayward residence.

On Monday, Peng appeared in court, speaking through a Mandarin interpreter. He told the judge that he understood the terms of the agreement and that he was guilty.

Prosecutors said Peng, under orders from a handler in China, left cash in hotel rooms in exchange for classified national security information.

However, the U.S. was never at risk since the information was provided by an FBI double agent who had also been approached by the Chinese government for spy-work but informed the U.S. government instead, according to prosecutors.

In the plea agreement, Peng said he was approached by a state security official with the People’s Republic of China during a business trip in 2015 and agreed to collect and deliver information. Between 2015 and 2018, he made six trips, leaving as much as $20,000 in envelopes at a time.

Peng’s arrest in September was part of an FBI sting operation that targeted Chinese intelligence operatives in the U.S. who were delivering national security information to China, according to the Justice Department.

Peng entered the country in 2001 on a temporary business visa. He became a lawful permanent resident in 2006 following his marriage and was naturalized in September 2012.

Investigators described him as a sight-seeing operator in the San Francisco area for Chinese visitors and students. Public records list Peng as president of U.S. Tour and Travel in San Francisco, although no website for the company was found.

A magistrate judge denied his earlier request for a free federal lawyer, saying he had too many assets, and refused to let him out on bail given that he had an apartment and a mistress in China.