In 1636, the Blessed Virgin asked through Mother Anne-Marie of Jesus Crucified, a French nun stigmatist whom Cardinal de Richelieu held in high esteem, that France be consecrated to her.
The following year, King Louis XIII of France, "in the secret of his heart", consecrated his person and his Kingdom to Mary, and with the Queen, Anne of Austria, he multiplied prayers and pilgrimages to obtain the heir they had awaited for 22 years.
The Mother of God responded by appearing to Brother Fiacre, a religious from the church of Notre-Dame-des-Victoires in Paris, recently founded by the King in gratitude for his first military achievements. Mary asked for three novenas: one to Our Lady of Cotignac in Provence, another to Our Lady of Paris, and a last one to Our Lady of Victories. The apparition was recognized as authentic and the Virgin Mary's message conveyed to the Queen.
Brother Fiacre finished the three novenas on December 5. Exactly nine months later to the day, Louis XIV was born. The heir received the baptismal name of "Louis Dieudonné" (God-given). As soon as the Queen was certain of her pregnancy, and without waiting for the birth to know if the child would be a boy or a girl, Louis XIII published a royal edict on February 10, 1638, which solemnly consecrated France to Mary.
Louis XIII made sure that this edict was recorded by the Parliament as an act of sovereign authority. He instituted a perpetual procession to be held every year on August 15, the feast of the Assumption, in all the churches of all the dioceses of the kingdom. Here is an excerpt from the edict of consecration of France to Mary, promulgated by King Louis XIII:
“So many evident graces have been received that … we felt compelled to consecrate ourselves to the greatness of God through his Son who lowered himself to us, and to his Son raised up to him by his mother; in whose protection we place in particular our person, State, crown and all our subjects, to obtain thereby the protection of the Holy Trinity, through his intercession and that of the whole heavenly court by his authority and example; since our hands are not pure enough to present our offering to Purity itself, we trust that the hands that were worthy to carry him will make them agreeable hosts; and it seems reasonable to think that she who mediated to obtain for us these benefits, will mediate on our behalf to give thanks to God.”
Cf. Encyclopedia Maria tome IV - Beauchesne 1956 - p. 714