The work by the Le Nain brothers represents a blond Baby Jesus meditating in front of the Holy Cross was sold at an auction at the Artigny château in the Loire valley.
It was probably painted in the 1640s, after Louis XIV's birth.
It was discovered by Philippe Rouillac and his son Aymeric in a 70-year-old woman's house.
She received it as a present from her grandmother, herself granddaughter of the collector and captain Henri Loret (1862-1950).
Culture Minister Françoise Nyssen has declared the work as of major interest for France's national heritage.
On the same day a rare porcelain moon flask that had belonged to Chinese Emperor Qianlong (1736-1795) was sold.
Qianlong was an avid art collector and the most powerful man in the world in his day.
This art object has the eight Buddhist symbols on it in stylised lotus petals.
In a sale that lasted about 10 minutes, a French woman outbid 17 Chinese buyers and bought it for more than five million euros - 10 times the auction's opening price.
The purchase was described as "historic and legendary".
Far-east art specialist Alice Jossaume said the flask is one of two flasks that had been owned by Emperor Qianlong still in existence.
The other was sold for 1.8 million euros in 2016.
A seal that had belonged to Qianglong sold for 21 million euros the same year.