 In 1708 he obtained a doctorate in law in Rome.On 26 January 1711, while in Rome, he was granted the benefits of dean and canon in Segovia Cathedral.In 1714 he was unexpectedly appointed confessor to Queen Elisabeth Farnese, second wife of King Philip V of Spain.