SAN FRANCISCO (AP) — A California family can sue to get back a Camille Pissarro painting that the Nazis looted from their Jewish ancestor even though she accepted a settlement from the German government for the masterpiece, a US appeals court said Monday.

The ruling by the 9th US Circuit Court of Appeals revived a lawsuit by Lilly Cassirer’s great-grandchildren, David and Ava Cassirer, over the 1897 oil-on-canvas Paris street scene.

Lilly Cassirer and her husband traded the painting for the exit visas that allowed them to flee Nazi Germany for England in 1939. The piece has been appraised at more than $30 million and has resided at Spain’s Thyssen-Bornemisza Museum since 1993.

The court said the museum failed to establish that it did not know the painting was stolen and sent the lawsuit back to a lower court for further action.

Thaddeus Stauber, an attorney for the museum’s manager, said he was confident its ownership of the painting would be confirmed by the lower court.

The museum has argued that it has well-documented ownership rights to the painting, which was purchased in good faith.

U.S. District Judge John F. Walter in Los Angeles determined two years ago that the artwork belongs to the museum under Spanish law but also concluded that Cassirer had no idea it still existed when she accepted payment for the painting in 1958.

David Cassirer has said his family didn’t learn of the work’s existence until a friend of his late father saw it in a museum catalog in 1999. Lilly Cassirer’s heirs filed a petition in Spain in 2001 and then a lawsuit in the US in 2005 after that petition was denied.

Sleuthing by both sides revealed that soon after Lilly Cassirer and her husband left Germany, the work — originally acquired by Lilly’s father-in-law from Pissarro’s art dealer — was sold to an anonymous German buyer.

It eventually arrived in the United States and was subsequently bought and sold more than once before Baron Hans-Heinrich Thyssen-Bornemisza, scion of Germany’s Thyssen steel empire and one of the 20th century’s most prominent art collectors, acquired it from New York gallery owner Stephen Hahn in 1976.

Thyssen-Bornemisza, who died in 2002, gave the painting and the rest of his collection to the Spanish government in 1993, creating the museum that bears his name.