NEW YORK - Iranian-American citizen Manssor Arbabsiar pleaded guilty on Wednesday to plotting with the Iranian military to kill the Saudi ambassador to United States.

Appearing at the New York federal court where he had been due to stand trial in January, Arbabsiar entered a surprise guilty plea. He faces up to 25 years in prison at his sentencing, which was set for January 23.

Judge John Keenan asked Arbabsiar: “Is it true that about the spring of 2011 up until the fall of 2011 that you and your co-conspirators ... who were officials in the Iranian military, that you agreed to cause the assassination of the Saudi Arabian ambassador to the United States?”

“Yes,” he replied, pleading guilty to three counts.

A frail looking man with a grey beard, Arbabsiar was brought in and out of the courtroom in handcuffs and kept under tight guard.

The nervous suspect had trouble recalling his age, saying: “58, I think.”

He alternated between casting worried looks around the courtroom and repeatedly smiling, including at the agents seated alongside the prosecutors.

Arbabsiar was arrested in September last year at New York’s John F. Kennedy International Airport, leading to a major legal and diplomatic drama between Washington and Tehran, amid already tense relations.

He has been charged along with co-defendant Gholam Shakuri, a senior member of the Iranian Revolutionary Guard’s elite Quds Force, who is at large.

Iran has strongly denied any involvement in what the United States says was a plot by the Quds Force, Iran’s covert external action unit, to kill the ambassador by hiring assassins from a Mexican drug cartel for $1.5 million.

To set up the alleged hit, Arbabsiar allegedly arranged for $100,000 to be wired to the United States as a down payment, the indictment says.