Hamilton joined the army in 1872, transferring to the 92nd Highlanders and serving with them in the Second Anglo-Afghan War (1878–80). In Afghanistan he caught the eye of Gen. Frederick Sleigh Roberts, with whom he was to be associated on a personal and professional basis for many years. Hamilton served in the First Boer War (1881), the expedition to relieve the Siege of Khartoum (1884–85), and campaigns in Burma (1886–87), Chitral (1895), and Tirah (1897–98). In the South African War (1899–1902) he commanded a brigade and a division, and he was later chief of staff to Lord Horatio Kitchener. Hamilton was knighted in 1902, and he headed a military observer mission (1904–05) with the Japanese armies in the Russo-Japanese War.

Upon his return to Britain, he was made head of Southern Command (1905–09) and served as adjutant general at the war office (1909–10). About that time Roberts, Hamilton’s former mentor, became the public face of a movement to introduce conscription to the British army. Roberts argued that Britain’s defense commitments both at home and abroad merited a dramatic expansion of the armed forces so as to secure the home isles from invasion. Popular support for that position compelled Secretary of State for War Richard Burdon Haldane to enlist Hamilton to pen Compulsory Service (1910), a point-by-point rebuttal of the arguments in favour of conscription. The relationship between Roberts and Hamilton was well known, and it added a personal element to a contentious policy debate. In the short term Haldane and Hamilton prevailed, but the merits—indeed, the necessity—of compulsory military service would become apparent within a year of the outbreak of World War I. In 1910 Hamilton became British commander in chief in the Mediterranean.

On March 12, 1915, Hamilton was placed in charge of the expeditionary force intended to seize control of the Dardanelles Strait and to capture Constantinople. It was to be the greatest test of his career, and as a commander he failed. During the next six months he conducted operations against the Turks at Gallipoli but suffered heavy casualties and made little headway. He remained unrealistically optimistic, and, when the British cabinet had begun to favour the evacuation of his force, he inopportunely reiterated his belief in the ultimate success of the campaign. He was recalled on October 16, 1915, and was given no further command. Hamilton was an exceptionally gifted officer of great personal courage, but he had spent nearly half of his career in administrative staff positions, and he was perhaps unprepared for an operation as complex as the Gallipoli Campaign. He wrote Gallipoli Diary, 2 vol. (1920).