After the Napoleonic abolitions, the altarpiece came to Brera from the church of San Bernardino in Urbino, erected by Federico da Montefeltro to house his own grave. It is likely that Federico commissioned it after the birth of his heir, followed by the death of his wife Battista Sforza (1472), and that he wanted to underline the protection granted by the Virgin to his own dynastic authority through this work dense in symbols.