Stewart was commissioned as an ensign in the 9th Bengal Native Infantry on 12 October 1840 and was promoted to lieutenant on 3 January 1844 and to captain on 1 June 1854. Later that year he served on the Aka Khel Expedition to the North-West Frontier. During the Indian Rebellion, after a famous ride from Agra to Delhi with dispatches, Stewart served as the deputy assistant adjutant-general at the Siege of Delhi in Summer 1857 and then as assistant adjutant-general at the Siege of Lucknow in Autumn 1857. After serving through the campaign in Rohilkhand he was promoted to major on 19 January 1858 and to lieutenant-colonel on 20 July 1858. He became deputy-adjutant-general of the Bengal Army in 1862 and, having been promoted to colonel on 20 July 1863, he commanded the Bengal brigade in the Abyssinian expedition in 1867. Promoted to major-general on 24 December 1868, he became commandant of the penal settlement of the Andaman Islands, and was present when one of the inmates assassinated Lord Mayo, British Viceroy of India, in 1872. After being exonerated in the subsequent inquiry, he was appointed Commander of the troops at Lahore in 1876. Promoted to lieutenant-general on 1 October 1877, Stewart commanded the Quetta Army during the Second Anglo-Afghan War advancing through the Bolan Pass to Quetta, and then on to Kandahar in January 1879. In March 1880, he made a difficult march from Kandahar to Kabul, fighting on the way the Battle of Ahmed Khel and Battle of Arzu, and then holding supreme military and civil command in northern Afghanistan. On hearing of the Maiwand disaster, he despatched Sir Frederick Roberts with a division on his celebrated march from Kabul to Kandahar, while he led the rest of the army back to India through the Khyber Pass. For this he was given the thanks of parliament and created a baronet. Stewart became Military member of the Council of the Governor-General of India in October 1880 and, having been promoted to full general on 1 July 1881, he became Commander-in-Chief, India in April 1881. In order to achieve efficiency savings he proposed merging the Bengal Army, Madras Army and Bombay Army into a single military force but this was rejected by the India Office. During the Panjdeh Incident in March 1885 he secured a significant increase in the number of British troops in India. He returned to London to become a member of the Council of the Secretary of State for India in 1893 and, in that role, again argued - this time successfully - for the creation of a single Indian Army. He was promoted to field marshal on 26 May 1894 and became a member of the Royal Commission on Indian civil and military expenditure as well as Governor of the Royal Hospital Chelsea from 1895 until his death on 26 March 1900. He died at Algiers in Algeria, and is buried in Brompton Cemetery in London.