At the time of the outbreak of the Mahdist War, he moved to HMS Duke of Wellington, the Commander-in-Chief's flagship in Portsmouth, then to HMS Iris, one of the first all steel ships, until 1884.[3]
In December 1884 Keppel was appointed to the 2nd Division of the Naval Brigade under Sir Charles Beresford serving on the Nile for the relief of Khartoum. As such, he was with Beresford on the Nile paddle gunboat Safia which had to run upriver to rescue Sir Charles Wilson and the men with him from the wrecked gunboat Talahawijeh and the Bordein, the latter having grounded on Mernat island during its return run (under fire) from Khartoum. It was during this journey that Wilson had established that Khartoum had fallen to the Mahdi and that, in all probability, Gordon was already dead.[4]
Keppel was slightly wounded in the successful but dangerous and arduous attempt to rescue Wilson and his men and get them back to the British base at Metemma; he was highly commended for his conduct and promoted to lieutenant. (Beresford : "I consider that we owe our safety on the steamer, as well as the safety of Sir C. Wilson and his party, who undoubtedly would have been killed if the steamer had been destroyed, to the untiring energy of Sub-Lieut. Keppel.")[5]
In October 1897, on loan to the Egyptian Government, Keppel commanded three gunboats on the Nile, which were despatched from the town of Berber, recently captured by British forces commanded by Herbert Kitchener, south to attack Metemmeh on the Nile, which was held by Dervishes.[6] At dawn on 16 October the ships attacked enemy troops at Shendi, before shelling three forts on the bank of the Nile near Metammeh, capturing some ships loaded with grain and then retiring.[6] They returned the following day to discover the defences had been reinforced with more artillery, but continued the bombardment from beyond range of the enemy guns.[6] Estimated Arab losses were 500 men, with one Soudanese soldier being killed on one of the gunboats.[6]
Keppel eventually commanded the entire Nile gunboat flotilla and played a major part in the successful British advance along the Nile, leading to the overwhelming victory at Omdurman and the occupation of Khartoum in September 1898. As a reward for his service with the gunboats, Keppel was decorated with the Distinguished Service Order and appointed Companion of the Order of the Bath.[7]
At the end of the campaign (which took Khartoum in September 1898), Keppel was instrumental in helping to deal with the diplomatically tricky situation upriver at Fashoda, where a French expedition under Major J. B. Marchand had established itself on the Nile. The confrontation, the famous "Fashoda Crisis", briefly looked as if it might cause a war with France, but was successfully and amicably settled.
Keppel served as Aide-de-Camp to King Edward VII from 1907 until the following year and as Extra Equerry from 1909.[1] After the king's death in 1910, Keppel was Extra Equerry to his successor King George V until 1912.[18] Keppel was nominated Equerry-in-Ordinary in 1913,[19] fulfilling this office for two years until his relinquishment in 1915, when he was again appointed Extra Equerry.[20] Subsequently, he held this post also to King Edward VIII[21] and King George VI until 1937.[22]
On 6 June 1889, he married Mary Blundell-Hollinshead-Blundell, daughter of Major General Richard Blundell-Hollinshead-Blundell, and had by her two daughters.[2] Marie, the older, became the wife of Charles Marsham, 6th Earl of Romney, while her younger sister Melita married Maurice Hely-Hutchinson.[7] Keppel died at his country residence, Grove Lodge, at Winkfield Row in Berkshire, aged 84 in 1947; his wife died ten years later.