William Nelson Pendleton began his military career after graduating fifth in his class from the United States Military Academy in 1830. He stayed within the military until 1833, when he resigned in order to pursue teaching. He decided at this time to enter the Episcopal ministry, and was ordained in 1838. He continued to both teach and perform his church duties until 1847, when he retired from teaching to focus on the church. In 1853, William Pendleton became the rector of Grace Church in Lexington, Virginia, a position he would hold throughout the war, as well as after.
At the outbreak of the Civil War, Pendleton was elected captain of the Rockbridge Artillery. Quickly promoted to colonel, Pendleton eventually rose to chief of artillery on the staff of General Joseph E. Johnston. On March 26, 1862, he was promoted to brigadier general, essentially achieving the position of chief of artillery for the army, though much of his service later in the war was administrative. He served with the army from the Battle of First Manassas all the way through the surrender at Appomattox Court House.