 Agreement proved difficult to attain and meanwhile the internal political situation in Portugal deteriorated.Castelo Melhor and his Francophile party were losing ground to the Anglophile party.The King was obliged to dismiss Castelo Melhor on 9 September 1667, in a palace coup organized by the king's wife Maria Francisca of Nemours and brother Pedro .