A former career US diplomat who had served as the US ambassador to Bolivia has pleaded guilty to working as an agent of Cuba for more than 40 years.
Victor Manuel Rocha, 73, was charged with secretly passing information to the communist-run Cuban government since 1981 while working for the US state department.
On Thursday, he changed his initial not guilty plea in a court in Miami.
He is due to be sentenced at a hearing on 12 April.
The move brings one of the highest profile espionage cases between Cuba and the US to an unexpectedly rapid conclusion.
Thursday's court hearing was supposed to be about how to handle classified documents involved in the case, according to the Miami Herald.
But instead, Mr Rocha, his lawyers, and prosecutors acknowledged that a plea deal had been struck.
When Judge Beth Bloom asked him if he wished to change his plea to guilty, he responded: "Your honour, I am in agreement."
He is charged with violating the Foreign Agents Registration Act by acting as a foreign agent, wire fraud and making false statements to obtain a US passport.
The evidence collected by investigators includes covert recordings of Mr Rocha admitting to working for Cuba for decades, praising the late Cuban leader, Fidel Castro as "Commandante", and calling the United States "the enemy".
He and his legal team now appear to have reached a similar conclusion, calculating that a guilty plea was his wisest option.
The BBC has contacted his lawyer for comment.
In effect, Mr Rocha must now accept the US government's accusation that he spent nearly his entire professional career working for the Cuban Revolution in US outposts in Havana and Buenos Aires while simultaneously rising in the US diplomatic service.
There's been no discussion in court as yet of Mr Rocha's sentence or whether he accepted a plea bargain in exchange for his co-operation.
James Olson, the CIA's former head of counterintelligence, told BBC News last month that the case illustrates how Cuba's intelligence services outwitted the US government.
"They owned us. They beat us. That's one of the reasons I have this personal grudge against the Cuban intelligence service because they have been so successful in operating against us," said Mr Olson.
"He's a traitor. He betrayed our country. I think that's contemptible, and I don't think he's going to see the light of day again," he added.
The US and Cuba have had a fraught relationship since Fidel Castro overthrew a US-backed government over 60 years ago.
The US imposed a trade embargo against Cuba in the 1960s. Former President Barack Obama and former Cuban President Raul Castro took steps to normalise relations in 2015, though former US President Donald Trump later reversed many of these actions.
Born in Colombia, Mr Rocha was raised in New York City and obtained degrees from Yale, Harvard and Georgetown.
He worked as US ambassador to Bolivia from 1999 to 2002, according to prosecutors, and served in several government roles - including at the National Security Council - for 25 years. In addition to Bolivia, he has also served in postings in Argentina, Honduras, Mexico and the Dominican Republic.
After leaving the diplomatic service, he continued in a lucrative private role consulting job as a special advisor to the US Southern Command, the part of the US military that oversees Cuba.
In November 2022, an undercover FBI agent contacted Mr Rocha via WhatsApp, claiming to be a representative of Cuban Intelligence Services delivering a message from "your friends from Havana", the charging document stated.
Mr Rocha agreed to meet the agent several times, including once at a food court, because there was "no possibility for anyone to see me" there, he said, according to court documents.
During three meetings with the undercover FBI agent, Rocha began to divulge details about his time working as a secret agent for the Cuban government, the charging document described.
Mr Rocha allegedly used the term "we" to describe Cuba and himself, and said he wanted to "protect ... what we have done".
When the agent, posing as a Cuban spy, asked him "are you still with us?" Mr Rocha responded that he was "angry" to have his loyalty questioned.
"It's like questioning my manhood," he said.
With additional reporting by Max Matza