MADRID — A paternity test has demonstrated that Salvador Dalí, the surrealist painter, was not the father of a woman who could have claimed part of his estate, the foundation responsible for the artist’s museums in Spain announced on Wednesday.

The Gala-Salvador Dalí Foundation said that the result of the paternity test should close what it called “an absurd and artificial controversy” about whether Dalí, who died childless, in fact had a daughter, Pilar Abel, following an alleged affair with her mother in the late 1950s. If Ms. Abel’s paternity lawsuit had been supported by forensic experts and the results of DNA testing, she could have claimed part of the estate worth hundreds of millions of dollars that Dalí left to the Spanish government.

Ms. Abel, a Tarot card reader, filed her lawsuit in 2015 against the Spanish state and the foundation. Her case made headway this year, after a judge ordered the exhumation of Dalí’s remains in order to carry out DNA testing.

In July, forensic experts opened Dalí’s tomb in a crypt beneath the museum he had designed in his hometown, Figueres, a top tourist destination in the Catalonia region. After the exhumation the experts said they were stunned to find the corpse remarkably intact — down to Dalí’s famously waxed mustache.