But days beforehand, "We received an offer it was impossible not to transmit to the owners of the painting," the Marc Labarbe auction house and art expert Eric Turquin said in a statement.
"The painting was sold privately to a foreign buyer," they said. "This sale is covered by a confidentiality agreement concerning the price and identity of the buyer."
It will leave France and be displayed in an unnamed "great museum", they said, adding that the owners had been "swayed" by the pledge to keep it in the public domain.
French media said that several top American museums had recently expressed an interest.
The remarkably well-preserved work was found in 2014 by the owners of a house in Toulouse as they sought to stop a leak in their attic. It had been kept there “for at least 100 years”.
Some Italian experts have questioned whether it is an original. But the painting underwent exhaustive, and mostly secret, analysis to establish its authenticity and is in surprisingly good condition, according to Mr Turquin.
The painting is the second by Caravaggio to depict the decapitation of the drunken Holofernes by Judith. The first, dating from around 1600, is on display at the Barberini Palace in Rome.