The daughter of Philip Willhelm, Elector and Count Palatine of Neuburg, the sitter grew up in Bavaria. In 1690 she was married to Carlos II of Spain, whose first wife had died childless the previous year: this portrait may have been commissioned to commemorate this occasion. Their marriage was not a happy one; Carlos was noted for his physical, intellectual, and emotional disabilities, along with his consequent ineffectual rule. Maria Anna also failed to produce an heir, in all probability because of the king's health problems, which ultimately resulted in the War of the Spanish Succession upon his death in 1700. Maria Anna had a reputation for being arrogant, vain and selfish, and was not much loved by the Spanish court. She was eventually forced to leave for Bayonne and was only permitted back to Spain two years before her death in 1740.