LOS ANGELES — A California man has been sentenced to four years in prison for acting as an illegal agent for the Chinese government while working as a campaign adviser for a local politician.

Yaoning "Mike" Sun, 65, was sentenced Monday in federal court in Los Angeles after pleading guilty last year in a deal with prosecutors. Under the agreement, Sun acknowledged acting as a foreign agent on behalf of the People's Republic of China from 2022 to 2024 without notifying the U.S. attorney general as required by law.

“When Americans vote for elected officials, they expect them to represent the interests of their constituents – not those of a foreign adversary like the Chinese government,” Roman Rozhavsky, assistant director of the FBI’s counterintelligence and espionage division, said in a statement. Federal prosecutors had asked for a five-year sentence for Sun.

Sun's lawyer, Adam Olin, declined to comment. In court papers, Olin asked for Sun to be sentenced to time served after spending more than a year in custody, contending his client lived a law-abiding life in the United States since moving from China in 1996.

“Mr. Sun’s conduct was not independently illegal and could have been performed consistent with the law had he only registered with the Attorney General — an obligation he did not know existed,” Olin wrote.

The case against Sun was filed during President Joe Biden's administration amid a time of rising concern that the Chinese government had cultivated a network of operatives to influence local elections in the U.S. to install politicians who were friendly to Beijing and could help promote Chinese interests.

According to the plea deal, Sun received instructions from Chinese government officials to post pro-Beijing content on a website he ran with another individual who became a candidate for local office and won election in 2022. Sun worked as a campaign adviser for the individual and the following year drafted a report for Chinese officials seeking funding and assignments for more pro-Beijing activities, according to the agreement.

While the individual was not named in court papers, Sun was listed as a campaign treasurer for Arcadia City Council candidate Eileen Wang on a 2022 campaign statement filing.

Wang earlier this month was sworn in as mayor of Arcadia, a city of nearly 60,000 people northeast of Los Angeles that has a sizable Asian population.