For years, “Over Vitebsk” occupied a central place in the collection of the Museum of Modern Art, which spoke of Marc Chagall’s painting of his hometown in the Russian empire as an important part of its holdings.

The work, by a Jewish artist, with a Jewish theme, had been previously owned by a gallery run by a Jewish dealer in Germany at the time of the Nazi takeover. Though its history was murky, and included a transfer of the work to a German bank during the Nazi era, the museum held the painting for decades, indicating it was confident it had good title.

But MoMA acknowledged last week that three years ago, without public announcement, it had changed its mind and returned the painting to the heirs of the German gallery.

The return of the Chagall is one of the quirkier art restitution cases by a museum in recent years, in part because of the financial agreement that accompanied its return to the heirs, who sold it last year for $24 million.

MoMA, which acquired the work in 1949, received $4 million in compensation for giving it back under an arrangement negotiated by a restitution company that represented the seven heirs.

One of the heirs and that company, Mondex Corporation, are now engaged in a court fight over the company’s fee, $8.5 million, according to court papers.