A Louisiana private investigator accused of trying to illegally obtain Donald Trump's tax returns before last year's U.S. presidential election has been arrested again.

At a hearing this week, a judge found that Jordan Hamlett violated conditions of his pretrial release that involved computer monitoring and tracking of his location.

Prosecutors say Hamlett tried unsuccessfully to obtain Trump's tax returns using a U.S. Department of Education financial aid website. Federal agents first arrested Hamlett last year on a charge that he misused a Social Security number in the effort.

Hamlett's attorney accused agents of tricking his client by luring him to a Baton Rouge hotel where they questioned him on Oct. 27, less than two weeks before the election.

At that time, the agents did not know whether Hamlett had been successful in obtaining Trump's tax returns, prosecutors said in court records. The agents feared a public release of the documents could influence the election, according to a transcript of testimony obtained by The Associated Press.

Hamlett's lawyer didn't immediately return phone and email messages Friday. On Wednesday, a judge ordered him held by the U.S. Marshals Service but left open the possibility he could return to home detention at some point while awaiting his December trial.

Court records describe how federal agents in October worried that Hamlett could be armed as they orchestrated an elaborate operation to lure him to the Embassy Suites in Baton Rouge for questioning. Plainclothes officers blended in with guests inside the hotel. Other officers took up positions outside.

Hamlett agreed to an interview in the hotel's atrium and the agents questioned him for hours in hushed tones inside the crowded lobby, authorities said.

Hamlett immediately took credit for his "genius idea" to seek Trump's tax returns from a U.S. Education Department financial aid website — even before he was accused of anything, Treasury Department Special Agent Samuel Johnson testified.

"He sounded somewhat, I would describe it as proud," Johnson said. "We spoke in lower voices because there was a number of people passing by and the information that we're discussing at this time relates directly to ... presidential candidate Trump and his tax returns."

Prosecutors have not revealed any possible motives for Hamlett's alleged attempt to get Trump's tax records. In court documents outlining the case, they wondered whether he was working with anyone or planned to sell them or release them.

Every president since Jimmy Carter has released their tax returns in what has become an American tradition during presidential elections, but Trump so far has refused to release his.