Maria Sophia of Neuburg

In December 1676, Maria Sophia's sister Eleonore Magdalene was married to Holy Roman Emperor Leopold I owing to the family's reputation as producing fertile women.

Isabel Luísa, Princess of Beira, heiress to the throne and only daughter of King Peter II, was childless and had been refused by most European sovereigns due to her sickly nature and strict Portuguese succession rights.

As a result, the Portuguese ambassador Manuel da Silva Teles was sent to Heidelberg to ask for the hand of Maria Sophia, with the encouragement of Empress Eleonore Magdalene.

Supposedly Louis XIV was "greatly chagrined" by Peter's decision to marry a daughter of the Elector Palatine and not a French princess, as he had hoped.

While she clashed with her widowed sister-in-law Catherine of Braganza on matters of etiquette, she was described as a popular queen who was decidedly generous and set about helping the poor of Lisbon.

She was frequently involved with charities that supported widows and orphans and allowed poor patients access to medical care at the royal palace.