Pepys had now been out of office for some time, but he was soon to have employment again. Tangier, which was acquired at the marriage of the King to Katharine of Braganza, had long been an incumbrance, and it was resolved at last to destroy the place. Colonel Legge (now Lord Dartmouth) was in August, 1683, constituted Captain-General of his Majesty’s forces in Africa, and Governor of Tangier, and sent with a fleet of about twenty sail to demolish and blow up the works, destroy the harbour, and bring home the garrison. Pepys received the King’s commands to accompany Lord Dartmouth on his expedition, but the latter’s instructions were secret, and Pepys therefore did not know what had been decided upon. He saw quite enough, however, to form a strong opinion of the uselessness of the place to England. Lord Dartmouth carried out his instructions thoroughly, and on March 29th, 1684, he and his party (including Pepys) arrived in the English Channel.
The King himself now resumed the office of Lord High Admiral, and appointed Pepys Secretary of the Admiralty, with a salary of L500 per annum. In the Pepysian Library is the original patent, dated June 10th, 1684: “His Majesty’s Letters Patent for ye erecting the office of Secretary of ye Admiralty of England, and creating Samuel Pepys, Esq., first Secretary therein.” In this office the Diarist remained until the period of the Revolution, when his official career was concluded.
A very special honour was conferred upon Pepys in this year, when he was elected President of the Royal Society in succession to Sir Cyril Wyche, and he held the office for two years. Pepys had been admitted a fellow of the society on February 15th, 1664-65, and from Birch’s “History” we find that in the following month he made a statement to the society:—
“Mr. Pepys gave an account of what information he had received from the Master of the Jersey ship which had been in company with Major Holmes in the Guinea voyage concerning the pendulum watches (March 15th, 1664-5).”
The records of the society show that he frequently made himself useful by obtaining such information as might be required in his department. After he retired from the presidency, he continued to entertain some of the most distinguished members of the society on Saturday evenings at his house in York Buildings. Evelyn expressed the strongest regret when it was necessary to discontinue these meetings on account of the infirmities of the host.
In 1685 Charles ii. died, and was succeeded by James, Duke of York. From his intimate association with James it might have been supposed that a long period of official life was still before Pepys, but the new king’s bigotry and incapacity soon made this a practical impossibility. At the coronation of James ii. Pepys marched in the procession immediately behind the king’s canopy, as one of the sixteen barons of the Cinque Ports.