Born January 10, 1810, in New Bern, North Carolina, Edward Stanly was the son of U.S. Representative John Stanly. He attended the New Bern Academy and Norwich University, graduating in 1829. After law studies, he was admitted to the bar in 1832. After four years of law practice in Beaufort, North Carolina, Stanly ran for a congressional seat on the Whig ticket. He served in the U.S. House of Representatives from 1837 until 1843. While in the House, Stanly used his great oratory skills to support the Union over states' rights. In subsequent years, he served in the North Carolina House of Commons, briefly as attorney general of North Carolina and then returned to the U.S. House of Representatives for two more terms. In 1853, Stanly moved west to California to practice law in San Francisco.
During the Civil War, when Union forces captured and occupied New Bern in 1862, Pres. Abraham Lincoln appointed Stanly military governor of eastern North Carolina. He held the rank of brigadier general. He later resigned this office due to a dispute with Lincoln over the Emancipation Proclamation. Stanly, though he was a Unionist, was a supporter of slavery and did not support emancipation. Stanly returned to California and practiced law until his death in 1872.