Hamilton was given command of the gunboat in February 1856 and took part in the Battle of Fatshan Creek in June 1857 during the Second Opium War. Promoted to[commander on 10 August 1857, he was given command of the sloop on the West Indies Station in June 1858.