Vincent Asaro, the reputed mobster charged in connection with the notorious 1978 Lufthansa robbery, walked out of federal court in Brooklyn on Thursday a free man after a jury cleared him of racketeering and other charges.

The verdicts, delivered after little more than two days of deliberations, left many in the courtroom stunned, most visibly prosecutors from the United States attorney’s office, which had spent years building a case against Mr. Asaro, 80, with testimony from high-ranking Mafia figures and recordings by an informer for the Federal Bureau of Investigation.

But the case relied heavily on the cooperation of some of those Mafia figures, some of them admitted killers, and the jury rejected the government’s accusation that Mr. Asaro helped carry out a criminal enterprise engaged in murder and robbery, most infamously the Lufthansa robbery, which figured prominently in the plot of the 1990 Martin Scorsese film “Goodfellas.”

When the juror chosen to deliver the verdict said “Not guilty” on the first count — the racketeering charge, by far the most complicated and serious of the charges — there was a startled silence in the courtroom.