Upon his recovery, he was assigned by Major General Benjamin Butler to the command of a gunboat flotilla on the James River labeled the "Naval Brigade" and was attached to the XVIII Corps, Army of the James from April 28, 1864 to February 17, 1865. Graham led the Naval Brigade during the First Battle of Fort Fisher. When the Union forces of the First Fort Fisher expedition returned to Virginia, Graham commanded the defenses of Bermuda Hundred, February 19, 1865 to March 19, 1865, and later the garrison of Norfolk, Virginia from March 19, 1865 to July 1865. He was mustered out of the volunteers on August 24, 1865.