He was born on November 24, 1818 in Lancaster County, Pennsylvania. He graduated from the medical department of the University of Pennsylvania in 1838, and a few years later set up in practice at Philadelphia and became a lecturer at the Philadelphia School of Anatomy. He married Margaret Irwin in 1841. He also helped found the Irwin & Agnew Iron Foundry in 1846. In 1852, he bought and revived the Philadelphia School of Anatomy, where he continued to work through 1862. He was appointed surgeon at the Philadelphia Hospital in 1854 and was the founder of its pathological museum.
For 26 years (1863–1889) he was connected with the medical faculty of the medical school of the University of Pennsylvania, being elected professor of operative surgery in 1870 and professor of the principles and practice of surgery in the following year. From 1865 to 1884—except for a brief interval—he was a surgeon at the Pennsylvania Hospital. In 1889 he became the subject of the largest painting ever made by the Philadelphia artist Thomas Eakins, called The Agnew Clinic, in which he is shown conducting a mastectomy operation before a gallery of students and doctors. The artist can also be found to the right of the painting.
During the American Civil War he was consulting surgeon in the Mower Army Hospital, near Philadelphia, and acquired considerable reputation for his operations in cases of gunshot wounds. He attended as operating surgeon when President Garfield was fatally wounded by the bullet of an assassin in 1881.
He was the author of several works, the most important being The Principles and Practice of Surgery (1878–1883). He died at Philadelphia on March 22, 1892, and is buried in West Laurel Hill Cemetery.