Patrick Sarsfield, 1st Earl of Lucan , was an Irish Jacobite and soldier, belonging to an Anglo-Norman family long settled in Ireland. Sarsfield gained his first military experience serving with an Anglo-Irish contingent of the French Army during the 1670s. When James II came to the throne he was commissioned in the English Army, and served during the suppression of Monmouth's Rebellion in 1685. During the Glorious Revolution of 1688 he remained loyal to James and led an English cavalry detachment at the Battle of Wincanton, the only military engagement of the campaign. In 1689 Sarsfield accompanied James to Ireland and served in the Jacobite Irish Army. After an early setback at Sligo, he became one of the celebrated Jacobite leaders of the war, noted in particular for Sarsfield's Raid shortly before the Siege of Limerick in 1690. James rewarded him by making him an Earl in the Peerage of Ireland. After the war's end following a second siege of Limerick in 1691, he led the Flight of the Wild Geese which took thousands of Irish soldiers into exile in France where they continued to serve James. After a planned invasion of England had to be abandoned following a French naval defeat in 1692, Lord Lucan  served in Flanders and was killed at the Battle of Landen in 1693.
Question: Who gave Patrick Sarsfield the title of Earl?
Answer: James II