A Chinese citizen who tried to enter President Donald Trump's Mar-a-Lago club Saturday carrying a thumb drive containing malicious software is being charged federally with lying to a Secret Service officer and having knowingly entered a restricted building.

When Yujing Zhang attempted to enter the club in Palm Beach, Florida, she was stopped by Secret Service agents at a security checkpoint, according to court documents.

She showed two Chinese passports with her name and photograph to the agents, who then took her to Mar-a-Lago security to see if she was a member of the club.

Mar-a-Lago allowed Zhang to enter, according to the documents, because part of her name matched that of a member of the club. Zhang gave a nondefinitive answer when asked if that member was her father, according to the court documents, and was admitted by the club "due to a potential language barrier issue." She was taken by shuttle to a second checkpoint.

Zhang had said she intended to go swimming at the club, according to court documents. At the second checkpoint, when she appeared unsure of where to go, according to the arrest affidavit, she told a club receptionist she was at Mar-a-Lago for a United Nations Chinese American Association event later that evening — a nonexistent event. The receptionist alerted a Secret Service agent, who detained Zhang for questioning.

In the affidavit, the agent said Zhang spoke very good English and during questioning "became verbally aggressive with agents."

She was found carrying four cellphones, a laptop, a hard drive and a thumb drive, but no swimsuit. After a preliminary forensic investigation, the thumb drive was found to contain "malicious malware," according to the affidavit.

Trump, who was at Mar-a-Lago for the weekend, was not at the club at the time Zhang entered. He was golfing at the Trump International Golf Club in West Palm Beach most of the day and did not return to Mar-a-Lago until around 4 pm.

First lady Melania Trump was at Mar-a-Lago when the incident occurred, along with other members of the president's family.

The Secret Service told NBC News, and court documents show, that Zhang was always in the company of Mar-a-Lago staff members or of the Secret Service and was never alone on club property.

A public defender appointed to represent Zhang declined to comment.

In a statement, a Secret Service spokesperson said, "On March 30, 2019, physical screening was conducted by the Secret Service once Mar-a-Lago staff determined an individual was to be granted access to the property. After the first physical screening, Mar-a-Lago staff transported the individual by a shuttle to the next screening checkpoint."

"After undergoing screening at the second Secret Service checkpoint the individual, per club protocol, was immediately met by club reception. The Mar-a-Lago reception staff then determined that the individual should not have been authorized access by their staff and Secret Service agents took immediate action resulting in the arrest of the individual."