MIAMI >> A former career U.S. diplomat told a federal judge Thursday he will plead guilty to charges of working for decades as a secret agent for communist Cuba, an unexpectedly swift resolution to a case prosecutors called one of the most brazen betrayals in the history of the U.S. foreign service.

Manuel Rocha’s stunning fall from grace could culminate in a lengthy prison term after the 73-year-old said he would admit to federal counts of conspiring to act as an agent of a foreign government.

Prosecutors and Rocha’s attorney indicated the plea deal includes an agreed-upon sentence but they did not disclose details at a hearing Thursday. He is due back in court April 12, when he is scheduled to formalize his guilty plea and be sentenced.

“I am in agreement,” said Rocha, shackled at the hands and ankles, when asked by U.S. District Court Judge Beth Bloom if he wished to change his plea to guilty. Prosecutors, in exchange, agreed to drop 13 counts including wire fraud and making false statements.

The brief hearing shed no new light on the question that has proved elusive since Rocha’s arrest in December: What exactly did he do to help Cuba while working at the State Department for two decades? That included stints as ambassador to Bolivia and top posts in Argentina, Mexico, the White House and the U.S. Interests Section in Havana.