[1] Hamley was promoted captain in 1850, and in 1851 went to Gibraltar, where he began his literary career by contributing articles to magazines.
He served throughout the Crimean campaign as aide-de-camp to Sir Richard Dacres, commanding the artillery, taking part in all the operations with distinction, and becoming successively major and lieutenant-colonel by brevet.
[1] During the war Hamley contributed to Blackwood's Magazine an admirable account of the progress of the campaign, which was afterwards republished.
Promoted colonel in 1863, he became a lieutenant-general in 1882, when he commanded the 2nd Division of the expedition to Egypt under Lord Wolseley, and led his troops in the Battle of Tell El Kebir, for which he received the KCB, the thanks of Parliament, and 2nd class of the Order of Osmanieh.
He also published some pamphlets on national defence, was a frequent contributor to magazines, and the author of several novels, of which perhaps the best known is Lady Lee's Widowhood.