Hay arrived from Paris at the exiled Jacobite court in Rome on 26 May 1717. Two days later, he visited
Pope Pius VI and kissed the Pontiff's foot. In February 1718, he was made a groom of the bedchamber to James Francis Edward Stuart (the "Old Pretender"). On 5 October 1718, James created Hay
Earl of Inverness, Viscount of Innerpaphrie and Lord Cromlix and Erne in the
Jacobite Scottish peerage. The Old Pretender appointed him his Secretary of State in 1725, and his wife and brother-in-law governess and tutor to the royal children at the same time. Thus John Hay and John Murray became known as the "King's favourites". Hay and his wife exerted considerable influence at the factious Jacobite court. In 1725, one of James Stuart's wife
Clementina's cited reasons for retiring to a convent was ill-treatment by Lord and Lady Inverness, and another was Murray's being imposed on her as her children's governor despite being a Protestant. These complaints may, however, have been influenced somewhat by the children's former governess Mrs Sheldon, sister-in-law of
John Erskine, 6th Earl of Mar. Mar's failed rebellion in 1715 and further intrigues had eventually led to his being replaced by Hay as James Stuart's intermediary between the exiled Jacobites and those still in Britain, and Mar had sworn revenge on Hay for this loss of royal favour. However, other Jacobites' correspondence suggests that some ill-treatment of Clementina by the Hays did occur, though the suggestion that Lady Inverness and James Stuart were having an affair, with Lord Inverness turning a blind eye, is less likely to be a fact than merely a rumour begun by Mar and the English government. Whatever the reasons for Clementina's retirement, however, it began to alienate James Stuart's supporters in Britain as well as the main contributors to his pension,
Pope Benedict XIII and the
King of Spain, and so he reluctantly accepted Hay's resignation as Secretary of State in 1727, upon which Clementina left the convent but threatened to return at any time should her husband or his court step out of line. James nevertheless elevated Hay in April 1727 to the titular Dukedom of Inverness and further created him Baron Hay in the Jacobite
Peerage of England. ==Later life==