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. He also received the CB and French and Turkish orders.