The discovery of the mustache was a striking, if unintended, outcome of the opening of Dalí’s tomb, in a crypt beneath the museum that he had designed for himself in his hometown, Figueres, which has also become one of the Catalonia region’s main tourism destinations.

Image Dalí in 1942. Credit... Associated Press

The forensics experts collected samples for a DNA test that a judge ordered last month in a case brought by a woman who says she is Dalí’s daughter. The results of the test are expected in a few weeks, which should allow the paternity case to resume in September.

If paternity is established, Pilar Abel, a 61-year-old Tarot card reader, could then claim part of the estate worth hundreds of millions of dollars that Dalí left to the Spanish state.

The foundation that oversees the painter’s estate had unsuccessfully tried to appeal the exhumation order. Mr. Peñuelas said at a news conference that the exhumation was carried out in complete privacy but had nevertheless created “an uncomfortable situation” for those who feel close to Dalí.

Ahead of the exhumation, Íñigo Méndez de Vigo, Spain’s culture minister, also described the procedure as a shame, but necessary if dictated by law. “It breaks my heart,” the minister told reporters on Thursday.