Gordon was born in Jerez de la Frontera, in southern Spain. At birth, he was named José María Gordon y Prendergast. Following Spanish naming conventions he had two family names, Gordon for his father and Prendergast for his mother. His Spanish-born parents of Scottish and Irish descent were descended from 18th century migrants from Scotland. Spanish was Gordon's mother tongue, but at age seven, in 1867, his family returned to Scotland, when his father had inherited the family estates. Gordon then learnt to speak English, but he retained an accent for many years, if not the rest of his life. He grew up in Britain, where he attended the artillery and engineering military academy at Woolwich, beginning in 1874. At that time, while still a cadet, he met the future King of Spain, Prince Alfonso, who was in exile, attending the military school at Sandhurst. Prince Alfonso was proclaimed King of Spain in December 1874 and received the news while he was dining with Gordon in London. During that time Spain was engaged in a civil war, the Third Carlist War, and Gordon told Prince Alfonso that he had made plans to travel to northern Spain and join his enemy Carlos, Duke of Madrid with the object of gaining military experience. Prince Alfonso told Gordon that he could give him a letter of recommendation so he could join the royalist army, but Gordon declined.
Military career
After he obtained his commission, Gordon was stationed in Ireland, but in 1879 he resigned in poor health and traveled to New Zealand with the hope of improving his health. In New Zealand he spent time as a drill instructor before moving to Melbourne and working as a journalist. He unsuccessfully tried acting, newspaper publishing, and being a merchant before joining the police force in Adelaide, South Australia in 1881. He subsequently joined the Australian Army as an officer in an artillery regiment. In South Australia he was appointed the first commander for Fort Glanville, the state's first coastal fortification. He was appointed on 8 September 1882 as a lieutenant and took charge of the fort and district. By 1892 he had been promoted to lieutenant colonel. That year he also married Eileen Fitzgerald; the couple had two children, Eileen and Carlos. He was promoted to colonel in 1893 and became the Commandant of South Australia's military forces in the same year, succeeding Major General M.F. Downes. During his career he was appointed a Companion of the Order of the Bath and temporarily made brigadier general. He wrote the training manual for all South Australian garrison artillery. In 1900 he went to South Africa where he participated in the Second Boer War, serving as chief staff officer for Overseas Colonial Forces. Following the federation of the Australian colonies Gordon was transferred to Victoria where he commanded the new Commonwealth Military Forces in the state until 1905, and later held a similar command in New South Wales between 1905 and 1912. Although he had been passed over for a number of senior appointments previously, Gordon subsequently held the position of Chief of the General Staff without promotion to major general during 1912–1914 in order not to extend his time until retirement. Gordon relinquished this position in July 1914 and was on his way to England on holiday when the First World War broke out. He subsequently offered his services to the Australian Army but was unsuccessful, probably due to his age. However, he subsequently commanded a number of reserve formations of the British Army in England during 1914–1915, and later served with the Army of Occupation in Germany in 1919. In 1921, he was given the honorary rank of major general and placed on the retired list. He published his autobiography the same year. He died of cancer in England in 1929. He was regarded as an able and intelligent officer and during his service he contributed to the foundation of early Australian military aviation and the setting up of the Lithgow Small Arms Factory.