A former aide to two New York governors was charged Tuesday with acting as an illegal agent of the Chinese government who used her state positions to subtly advance Beijing’s agenda in exchange for financial benefits worth millions of dollars.

Linda Sun, who held numerous posts in New York state government, including deputy chief of staff for Gov. Kathy Hochul and deputy diversity officer for former Gov. Andrew Cuomo, was arrested Tuesday morning along with her husband, Chris Hu, at their $4 million home on Long Island.

Federal prosecutors said Sun, at the request of Chinese officials, blocked representatives of the Taiwanese government from having access to the governor’s office and shaped New York governmental messaging to align with the priorities of the Chinese government, among other things.

In return, her husband got help for his business activities in China — a financial boost that prosecutors said allowed the couple to buy their multimillion-dollar property in Manhasset, New York, a condominium in Hawaii for $1.9 million, and luxury cars including a 2024 Ferrari, the indictment says.

Sun also received smaller gifts, the indictment said, including tickets to performances by a visiting Chinese orchestra and ballet groups and “Nanjing-style salted ducks” that were prepared by the personal chef of a Chinese government official and delivered to Sun’s parents’ home in New York.

If true, the allegations show that Chinese authorities were able to gain influence at the highest levels of state government in New York for nearly a decade.

“As alleged, while appearing to serve the people of New York as Deputy Chief of Staff within the New York State Executive Chamber, the defendant and her husband actually worked to further the interests of the Chinese government and the CCP,” United States Attorney Breon Peace said, using the acronym for the Chinese Communist Party. “The illicit scheme enriched the defendant’s family to the tune of millions of dollars.”

Sun and Hu pleaded not guilty during an initial court appearance on Tuesday afternoon in Brooklyn and will be released on bond. Sun has been barred from having any contact with the People’s Republic of China’s consulate and mission.

The case is part of a broader Justice Department effort to root out secret agents for the Chinese government operating in the United States. In recent years, federal authorities have charged Chinese nationals not only with covertly advancing Beijing’s interests but also with harassing and intimidating dissidents on the government’s behalf.

Last year, the Justice Department charged a pair of men with establishing a secret police station in New York City while acting under the direction and control of the Chinese government.