A California federal judge has ruled against the heirs of a Jewish woman who was forced to sell a Camille Pissarro painting to the Nazis while fleeing Germany in 1939, instead allowing a Spanish museum to maintain possession of the masterpiece.

Relatives of Lilly Cassirer have been trying to regain ownership of a 19th century canvas work, “Rue Saint-Honoré, Après-midi, Effet de Pluie,” which a Nazi appraiser originally seized from Cassirer for the nominal sum of $360 during World War II.

U.S. District Judge John Walter ruled the Thyssen-Bornemisza Museum in Madrid could continue to keep the masterpiece on display.

On Thursday, the Cassirer family's attorney promised to appeal Walter's ruling, saying the museum's position is "morally and legally wrong."

Lilly Cassirer’s grandson, Claude Cassirer, originally found out about the painting after a friend saw it in the museum in 2000, setting off the legal battle.

After Claude’s death, family members David and Ava became plaintiffs in the suit, along with the United Jewish Federation of San Diego County, the Associated Press reported.

The Cassirer family argued in court records that the museum ignored red flags about the painting's origin, including a "Berlin" label on the back and the fact that Pissarro paintings were frequent targets of Nazi looting.

The painting later surfaced in the U.S. in 1951, and was sold among various art collectors and dealers until it was bought in 1976 by Baron Hans-Heinrich Thyssen-Bornemisza, and put on display in the Spanish museum.

Thaddeus Stauber, an attorney who represents the museum, said the museum acquired the painting from the baron "in good faith" and that the German government compensated the family, giving them an unknown amount of money for the artwork, in the 1950s.

"The painting has been in the public domain for over 40 years," Stauber said. "If somebody was looking to conceal something, looking to hide the past of a wonderful painting like this doesn't have it put on public display, have it travel and have it published. They would have sold it in some marketplace."

After ruling that Spanish law could be applied in the case, Walter found that the museum rightfully owns the 1897 Pissarro masterpiece, and is not required to return it to the American family.

In last week's decision, Walter nonetheless urged the institution to think about what would be fair to victims of Nazi persecution like the Cassirer family.

An attorney for the museum told the Associated Press it acquired the painting in good faith and has owned it for more than 20 years.

Evelio Acevedo Carrero, managing director of the foundation that operates the museum, told the New York Times he would consider placing a plaque commemorating the fact the masterpiece was one of numerous artworks confiscated by the Nazi regime, or some other form of what he called “moral recognition” of the piece’s past.

“Museums and governments around the world recognize the need to return Nazi-looted art to its rightful owners,” Laura Brill, an attorney for the Cassirer family told the Associated Press, “The museum is not doing the right thing here.”

Acevedo said it was “clear” that Germany’s postwar government already compensated the Cassirer family for the painting.

“Not all the cases related to Nazism have gone the same way,” he said.

The Associated Press contributed to this report.