A US Secret Service agent put a USB drive taken from a Chinese woman who tried to gain access to Donald Trump’s private Florida club into his government computer, triggering an immediate download of malicious software.

The “very out-of-the-ordinary” incident was revealed by another Secret Service agent, Samuel Ivanovich, who testified on Monday at a detention hearing against Yujing Zhang, a 32-year-old Chinese national arrested late last month for trying to enter Mar-a-Lago.

According to an affidavit filed by an agent and seen by the Miami Herald, Ms Zhang gave the Secret Service conflicting accounts of why she went to the US president’s club on 30 March.

She was found carrying several electronic devices, including a USB stick containing “malicious malware”. That raised suspicions among investigators Ms Zhang may be spying, the newspaper reported.

One federal prosecutor argued in court Ms Zhang “lies to everyone she encounters”, and said a search of her hotel room uncovered more than $8,000 (£6,120) in cash, nine thumb drives, five SIM cards and a “signal-detector” – a portable device than can detect hidden cameras.

Mr Ivanovich, who interviewed Ms Zhang the day she was arrested, told the Florida court a colleague who inserted the USB drive into his computer had to immediately stop the analysis to prevent any further corruption of his computer, according to CNN. The analysis was ongoing but inconclusive, he said.

The FBI has reportedly launched a counterintelligence investigation, but Ms Zhang’s lawyer, Robert Adler, said evidence his client had paid for a travel package that included a visit to Mar-a-Lago could weaken any allegation she lied to agents about the trip.

Inside Mar-a-Lago - Trump's holiday home Show all 20 1 /20 Inside Mar-a-Lago - Trump's holiday home Inside Mar-a-Lago - Trump's holiday home Donald Trump sits in the living room at Mar-a-Lago in 1993. The following pictures show the interior of the Mar-a-Lago estate. Many of them are from before Trump bought the property in 1985 but, as the newer pictures show, he hasn't done much with the place Rex Inside Mar-a-Lago - Trump's holiday home The dining room at Mar-a-Lago under Trump. The following pictures show the interior of the Mar-a-Lago estate. Many of them are from before Trump bought the property in 1985 but, as the newer pictures show, he hasn't done much with the place Rex Inside Mar-a-Lago - Trump's holiday home The dining room at Mar-a-Lago in 1967. The following pictures show the interior of the Mar-a-Lago estate. Many of them are from before Trump bought the property in 1985 but, as the newer pictures show, he hasn't done much with the place US National Park Service Inside Mar-a-Lago - Trump's holiday home The dining room at Mar-a-Lago under Trump in 2015 The Washington Post/Getty Inside Mar-a-Lago - Trump's holiday home Function room at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Donald Trump sits in the living room at Mar-a-Lago in 1993. Rex Inside Mar-a-Lago - Trump's holiday home The living room in Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Master bedroom at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Library at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Cloister at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Entrance hall at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Spiral staircase at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home The dining room at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Patio at Mar-a-Lago in 1928 US National Park Service Inside Mar-a-Lago - Trump's holiday home Cloister at Mar-a-Lago in 1967 US National Park Service Inside Mar-a-Lago - Trump's holiday home Mar-a-Lago in 2018 Getty Inside Mar-a-Lago - Trump's holiday home Mar-a-Lago in 2018 Getty Inside Mar-a-Lago - Trump's holiday home Mar-a-Lago in 2018 Getty Inside Mar-a-Lago - Trump's holiday home Mar-a-Lago in 2018 Getty Inside Mar-a-Lago - Trump's holiday home Mar-a-Lago in 2018 AFP/Getty

One reason she allegedly gave was that she had been invited to a social event promoted online by Li Yang, a Florida massage parlour owner who ran a separate business touting her clients access to the Trump administration at Mar-a-Lago.

The court hearing was held to rule on whether Ms Zhang should be released on bond, but judge William Matthewman delayed any decision until next week. Ms Zhang is currently detained in Palm Beach County jail.

Inside Trump's Mar-a-Lago dining room: A look at the 32-seat setup for Donald Trump to host Chinese President Xi Jinping

Ms Zhang is facing charges of lying to a federal office and entering restricted property. She is not facing charges of espionage.