After the overthrow of the Philippine Dynasty on 1 December 1640, which had ruled Portugal since 1580, João, Duke of Braganza became king and the ducal chapel moved from Vila Viçosa to Lisbon. In 1641, after the retirement of Filipe de Magalhães, Marcos Soares Pereira was appointed "mestre da Capela Real", a position he held until his death in 1655.