Agnew was born in Ballyclare, Ireland and educated at London, Paris and Glasgow; he qualified for the medical profession, M.R.C.S.(London) in 1838, and M.D.(Glasgow) 1839. Soon after he went to Australia, arriving at Sydney before the end of 1839. He decided to settle in the west of Port Phillip District (now the Western district of Victoria), but not enjoying the life, went to Melbourne, where he was offered the position of private secretary to John Franklin, then governor of Van Diemen's Land (now Tasmania). He sailed for Hobart in 1841 and found that the position had been filled. He was, however, soon appointed assistant surgeon at the Cascades Peninsula. Later in 1841 he was appointed assistant surgeon to the Saltwater River probation station, located on the Tasman Peninsula In 1845 he transferred to the General Hospital at Hobart, later becoming colonial surgeon.
This was followed by private practice in Hobart for 36 years. He had joined the Tasmanian Society, afterwards the Royal Society of Tasmania, in 1841, and in that year contributed an article to its journal on the "Poison of the Tasmanian Snakes". In March 1851 he was elected a member of the council and remained on the council until his death some 50 years later. He had abandoned practising medicine when he took up political life full-time in 1877. He was honorary secretary from 1861 to 1893, and for several years a vice-president.
Agnew retired from his medical profession and was elected by Hobart to the Tasmanian Legislative Council in 1877. He was a member of the Philip Fysh 'Fysh-Giblin' ministry in that year, without portfolio, and was also in the William Giblin ministry which succeeded it, and in the second Giblin ministry from October 1879 to February 1881.
Agnew was then absent from the colony on a long visit to Europe. After his return he was elected to the Tasmanian Legislative Council in 1884, and on 8 March 1886 he took over from Adye Douglas and formed a ministry in which he was premier and chief secretary. This lasted a little more than 12 months and he resigned his post and political life on 29 March 1887. His last years were spent at Hobart where he died on 8 November 1901.
Agnew was created K.C.M.G. July 1894 formalised in January 1895. He married Louisa Mary Fraser in 1846 who died in 1868; he remarried in 1878 to Blanche Legge. There were several children by the first marriage, of whom only a daughter survived him.
Agnew was much respected in Hobart all his life. He was a useful politician, and his general interests, especially in the cultural life of the community, made him one of the best-known men in Tasmania. He was a founder and fostered the Royal Society of Tasmania and gave many volumes to its library, he was much interested in the museum and botanical gardens and the public library, of which he was chairman. He was also president of the Tasmanian Racing Club and of the Tasmanian Club
His service to Tasmania came from his involvement with scientific studies and encouragement of art.
Agnew joined the council of the Royal Society of Tasmania in 1851 and was honorary secretary in 1861–81 & 84–94; was chairman of the boards that administered the public library and museum, a member of the council of education and for a short term he was a member of the council of the university. His legacy also includes famous catchphrases such as "boider" "goody proctor" and an all-time favourite "bopsey".