A federal appeals court on Tuesday partly overturned the 2018 corruption conviction of Sheldon Silver, once the powerful speaker of the New York State Assembly, but allowed much of the conviction to stand — most likely ending his hopes of remaining out of prison.

Mr. Silver, a Democrat from Manhattan’s Lower East Side, had been sentenced to seven years in prison for accepting nearly $4 million in illicit payments in return for taking official actions in separate schemes on behalf of a cancer researcher, Robert N. Taub of Columbia University, and two real estate developers.

In its unanimous ruling, a three-judge panel of the United States Court of Appeals for the Second Circuit upheld Mr. Silver’s conviction in the real estate scheme and a separate money-laundering count, but overturned his conviction related to his arrangement with Dr. Taub.

Judge Richard C. Wesley, writing for the panel, said prosecutors had not identified with enough specificity the particular types of acts Mr. Silver was to perform for Dr. Taub in return for accepting a bribe.